Considering this example how do I get or set anything on the form from the Main code?
All we have is a simple Main function like
@Override
public void start(Stage stage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("fxml_example.fxml"));
Scene scene = new Scene(root, 300, 275);
stage.setTitle("FXML Welcome");
stage.setScene(scene);
stage.show();
}
A form defined in FXML.
And a controller class which is never instantiated explicitly.
As I don't have a link to the controller class instance in the Main code, how do I access anything on the form from outside the controller?