I've just written a JavaFX application and realized I don't really understand how it actually starts up.
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = new FXMLLoader(this.getClass().getResource("view.fxml")).load();
primaryStage.setTitle("Dice Roller");
primaryStage.setScene(new Scene(root));
primaryStage.show();
}
public static void main(String[] args) {
launch(args);
}
This is the template given to me in Intellij. My entry point would be main where the only thing that gets run is launch(args). I've tried digging in the Application class but didn't find anything that would point towards running the start method. How is this even launched? Since JavaFX has it's own thread I'm assuming a thread gets created in the launch method and the main thread doesn't return from launch until you call Platform.exit or just close all windows. This all feels just a bit too abstract to me right now. Can someone explain to me how it all fits together?