Considering this example how do I get or set anything on the form from the Main code?
All we have is a simple Main object like
object Main extends JFXApp {
val resource = getClass.getResource("/AdoptionForm.fxml")
val root: jfxs.Parent = jfxf.FXMLLoader.load(resource)
stage = new PrimaryStage() {
title = "FXML GridPane Demo"
scene = new Scene(root)
}
}
A form defined in FXML.
And a controller class which is never instantiated explicitly.
As far as the controller is a class (not an object) and I don't have a link to its instance in the Main code, how do I access anything on the form?
The final goal I seek to reach is to have an actor that would listen to incoming messages and update the form with the data gotten.