Add class/object construction/initialization code to the code execution buffer.
Add class/object construction/initialization code to the code execution buffer.
This function is called multiple times (by the Scala compiler) with the initialization/construction code of each class and object (but not trait!) that extends JFXApp. This code is buffered until it can be executed in main().
Class/object construction code to be buffered for delayed execution.
You are strongly advised not to override this function.
Perform app-related initialization, and execute initialization/construction code for all classes and objects that extend this trait.
Perform app-related initialization, and execute initialization/construction code for all classes and objects that extend this trait.
Command line arguments.
You are strongly advised not to override this function.
Set of parameters for an application
Set of parameters for an application
JFXApp stage must be an instance of scalafx.application.JFXApp.PrimaryStage to ensure that it actually is a proper wrapper for the primary stage supplied by JavaFX.
This method is called when the application should stop, and provides a convenient place to prepare for application exit and destroy resources.
This method is called when the application should stop, and provides a convenient place to prepare for application exit and destroy resources.
It is called from javafx.Application.stop method. The implementation of this method provided by the JFXApp class does nothing.
NOTE: This method is called on the JavaFX Application Thread, the same as javafx.Application.stop method.
ScalaFX applications can extend JFXApp to create properly initialized JavaFX applications.
On the back end
JFXApp
first calls javafx.application.Application.launch then executes body of its constructor when javafx.application.Application.start(primaryStage:Stage) is called. Here is an example use: