ScalaFX applications can extend JFXApp3 to create properly initialized JavaFX applications.
ScalaFX applications can extend JFXApp3 to create properly initialized JavaFX applications.
On the back end JFXApp3
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:
object SimpleScalaFXApp extends JFXApp3 {
override def start() : Unit = {
stage = new PrimaryStage {
title = "Simple ScalaFX App"
scene = new Scene {
root = new StackPane {
padding = Insets(20)
content = new Rectangle {
width = 200
height = 200
fill = Color.DEEPSKYBLUE
}
}
}
}
}
}
- Companion
- object
Value members
Abstract methods
Concrete methods
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.
- Value Params
- args
Command line arguments.
- Note
You are strongly advised not to override this function.
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 JFXApp3 class does nothing.
NOTE: This method is called on the JavaFX Application Thread, the same as javafx.Application.stop method.
Concrete fields
JFXApp3 stage must be an instance of scalafx.application.JFXApp3.PrimaryStage to ensure that it actually is a proper wrapper for the primary stage supplied by JavaFX.
JFXApp3 stage must be an instance of scalafx.application.JFXApp3.PrimaryStage to ensure that it actually is a proper wrapper for the primary stage supplied by JavaFX.