Java Magazine, Sept/Oct 2017
ORACLE COM JAVAMAGAZINE SEPTEMBER OCTOBER 2017 60 javafx controller by setting a ControllerFactory Armed with this knowledge you only need to go back to the applications entry point and configure the FXMLLoader instance with this new information for example sample AppMain java package sample import javafx application Application import javafx fxml FXMLLoader import javafx scene Scene import javafx scene layout VBox import javafx stage Stage import java net URL public class AppMain extends Application @ Override public void start Stage primaryStage throws Exception Initialized via DI framework AppController controller URL location getClass getResource app fxml FXMLLoader fxmlLoader new FXMLLoader location set the ControllerFactory fxmlLoader setControllerFactory param controller VBox vbox fxmlLoader load Scene scene new Scene vbox primaryStage setScene scene primaryStage sizeToScene primaryStage show
You must have JavaScript enabled to view digital editions.