JavaFx optional parameters for controller class in start method when it is loaded into the FXML
问题 with the ScheneBuilder I defined the controller class of my fxml, the code genereted inside my AnchorPane tag is: fx:controller="demo.SplashController" now I would like if I had args in the main, to load a new version of the controller, using the appropriate construct. I try this code in the Application.start: FXMLLoader loader = new FXMLLoader(getClass().getResource("page.fxml")); PageController controller; if(!dir.equals("")){ //attribute coming from args controller = new PageController(dir