JavaFX
JavaFX
JavaFX-Architecture
• complete API with a rich set of classes and interfaces
• to build GUI applications with rich graphics
Packages
• javafx.animation:classes to add transition based animations such as fill,
fade, rotate, scale and translation, to the JavaFX nodes.
• javafx.application: a set of classes responsible for the JavaFX application life
cycle.
• javafx.css: classes to add CSS–like styling to JavaFX GUI applications.
• javafx.event: classes and interfaces to deliver and handle JavaFX events.
• javafx.geometry: classes to define 2D objects and perform operations
• javafx.stage: This package holds the top level container classes for JavaFX
application.
• javafx.scene: This package provides classes and interfaces to support the
scene graph. In addition, it also provides sub-packages such as canvas, chart,
control, effect, image, input, layout, media, paint, shape, text, transform,
web, etc. There are several components that support this rich API of JavaFX.
Scene Graph
• GUI Applications were coded using a Scene Graph.
• starting point of the construction of the GUI Application.
• application primitives that are termed as nodes.
• A node is a visual/graphical object and it may include
• Geometrical (Graphical) objects – (2D and 3D) such as circle, rectangle,
polygon, etc.
• UI controls – such as Button, Checkbox, Choice box, Text Area, etc.
• Containers – (layout panes) such as Border Pane, Grid Pane, Flow Pane, etc.
• Media elements – such as audio, video and image objects. In general, a
collection of nodes makes a scene graph.
• All these nodes are arranged in a hierarchical order as shown below: