Beruflich Dokumente
Kultur Dokumente
applications
extend
from
the
javafx.application.Application class. The Application class
provides application life cycle functions such as initializing,
launching, starting, and stopping during runtime. This provides a
mechanism for Java applications to launch JavaFX GUI
components separate from the main thread.
Public class HelloWorldMain extends Application {
Public static void main(String[] args) {
//Main Thread
Application.launch(args);
}
Public void start (Stage PrimaryStage) {
//JavaFX application thread
//JavaFX code here
}
}
Steps:
1. In main() method we launch the FX application by passing in
command line arguments to the Application.launch()
method. To access the arguments passed into the launch()
method, we can invoke getParameters()method of the
Application
class.
2. After the Application.launch() method has executed, the
application will enter a ready state and the frameworks
internal will invoke a start() method. At this point, the
program execution occurs on the JavaFX application thread
and
not
on
the
main
thread.
3. When the start()
method is invoked, a JavaFX
javafx.stage.Stage object is available for the developer to
use
and
manipulate.
Data Type
Description
fill
javafx.scene.paint.Paint
smooth
Boolean
strokeDashOffs
et
strokeLineCap
Double
strokeType
strokeWidth