Is it possible to add a controller to a Scene? such that it has the same effect as adding the loaded Nodes from the FXML? What I am currently doing to load my FXML is this:
fxmlLoader = new FXMLLoader(getClass().getResource("fxml"));
Parent page = null;
page = fxmlLoader.load();
And I am able to attach the Parent to the scene. But if , instead, I attach the controller that I get with this code (just below the previous code):
controller = fxmlLoader.getController();
Then attaching this controller to my scene does not do anything, nothing shows.