Getting Started with JavaFX Scene Builder 1.1

Previous
Next

4 Bind the UI to the Application Logic

This chapter describes the steps to bind the FXML layout you are building with JavaFX Scene Builder to the source controller file that has been provided with the IssueTrackingLite sample.

The controller source file, IssueTrackingLiteController.java, will manage the events and actions taken on each element you add to the FXML UI layout that you are building.

  1. In the Hierarchy panel, select the row for the root (top) AnchorPane element.

  2. Click the Code section of the Inspector panel.
    If you are using NetBeans IDE to complete this tutorial, notice that the Controller class text field already has the value issuetrackinglite.IssueTrackingLiteController, as shown in Figure 4-1. When you initially created the FXML file in NetBeans IDE, you specified that file name as the controller source file to bind with the UI layout you are creating.

    If you chose not to use NetBeans IDE to complete this tutorial, enter issuetrackinglite.IssueTrackingLiteController in the Controller class text field.

    Setting the controller class file name enables JavaFX Scene Builder to provide you with the names of the event handlers and instance variables that are declared in the controller source file

    Figure 4-1 Add Controller Class

    Description of Figure 4-1 follows
    Description of "Figure 4-1 Add Controller Class"

  3. Click the drop-down arrow in the Controller class field. If there are other controller class files available, it will be listed in a drop-down list and you can choose from the list to replace what is already defined, if necessary.

Previous
Next