JavaFX Tutorial Slides.
Watch the video series here:
https://www.youtube.com/watch?v=kKKtgstZ5qM&list=PLje_ti-y5EoL6PDfH3x5d8FMOpEHgHYVF
K. N. Toosi University of Technology
Brought to you by
Graphical User Interface in Java
Using JavaFX
Getting Started
1K. N. Toosi University of Technology
JavaFX Application Life Cycle:
Each JavaFX application needs to extend the
javafx.application.Application class, which defines the
life cycle of an application.
• Application.init(): Can be used to define and prepare
everything before the UI shows up.
• Application.start(Stage stage): You should override this
method and build and display your UI in it.
• Application.stop(): This method will call when the
application terminates.
2K. N. Toosi University of Technology
launch()
init()
start()
stop()
Structure of a JavaFX Application:
13K. N. Toosi University of Technology
Stage
Scene
Parent Root
Node
Node
Node
Node
Node
Node
Scene
Parent Root
Node
Node
Node
Node
Node
Node
Login Scene
Scene
Parent Root
Node
Node
Node
Node
Node
Node
Admin Scene
JavaFX Class Hierarchy:
14K. N. Toosi University of Technology
Node
Shape3D Shape2D Parent
Group Region
Chart Pane
VBox HBox AnchorPane
Control
WebView
Canvas ImageView
Live Coding: Line Patterns
15K. N. Toosi University of Technology
https://gist.github.com/mhrimaz/0c9f5234ed779ad74dc91707dbd0b65d
Live Coding: Recursive Graphic
Sierpinski Carpet
16K. N. Toosi University of Technology
https://github.com/mhrimaz/SierpinskiCarpetFX