12.1 The Structure of a JavaFX Application

The top-level structure in a JavaFX application is the stage, which corresponds to a window. A stage can have one or more scenes, which are top-level containers for nodes that make up the window contents. A node can be a user interface control, such as a button or a drop-down list; a layout; an image or other media; a graphical shape; a web browser; a chart; or a group. In this chapter, we concentrate on user interface controls, layouts, charts, and images.

To create a JavaFX GUI, we add nodes to a scene. These nodes are arranged in a hierarchy, called a scene graph, in which some nodes are children of other nodes. The top node is called the root.

JavaFX applications can be built in several ways. ...

Get Java Illuminated, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.