Java Reference
In-Depth Information
The Code section lists all the event handlers the selected node in the Content Panel could have. It also allows
you to set the fx:id for the selected node. You can hook up the event handlers in the Code section in any way you
want, but the most convenient way of providing event handlers is to set them to properly signatured methods in the
controller. Figure 3-30 shows the Code section of the Inspector Panel.
Figure 3-30. The Code section of the Inspector Panel
Summary
In this chapter, you learned the declarative way of creating a UI in JavaFX. You learned the following important tools
and information:
FXML files are the carriers of declarative UI information, and are central assets of JavaFX
projects.
FXMLLoader . The result of the loading is a
FXML files are loaded into JavaFX applications by
node that can be incorporated into a Scene .
FXML files can have a companion controller class that performs programmatical functions,
such as event handling, at runtime on behalf of the nodes declared in the FXML file.
FXML files can be edited easily in your favorite Java IDEs with smart suggestions and
completions.
FXML files can also be edited in Oracle JavaFX SceneBuilder 2.0, an open source tool for
editing FXML files.
The JavaFX SceneBuilder is a highly productive tool for specifying JavaFX UIs. You can add
containers, controls, and other JavaFX nodes into the content of an FXML file.
fx:ids of the various nodes in the scene.
You can set up a controller and define the
You can organize the hierarchical information in an FXML file by manipulating the containers,
controls, and other nodes in the Hierarchy section of the Document Panel.
 
Search WWH ::




Custom Search