I have two controllers. They both inherit from the Application class. The first window/controller loads when the application starts, the second window/controller loads when a button is clicked. It works, except for this question:
What is the entry point of the second window/controller? In the first controller I can put code in the start method but that method in the second window/controller does not get called.
This code runs in the first controller to launch the second controller:
try {
FXMLLoader fxmlLoader = null;
// Open the New Process A Query Window
fxmlLoader = new FXMLLoader(getClass().getResource("processAQuery.fxml"));
Parent root = fxmlLoader.load();
Stage stage = new Stage();
stage.setScene(new Scene(root, 988, 833));
stage.show();
} catch (Exception ex) {
// ...
}
I am using SceneBuiler to create the FXML.