25.5.3 Building the App’s GUI

In this section, we’ll show the precise steps for using Scene Builder to create the Tip Calculator’s GUI. The GUI will not look like the one shown in Fig. 25.9 until you’ve completed the steps.

fx:id Property Values for This App’s Controls

If a control or layout will be manipulated programmatically in the controller class (as we’ll do with one of the Labels, all of the TextFields and the Slider in this app), you must provide a name for that control or layout. In Section 25.5.4, you’ll learn how to declare variables in your source code for each such component in the FXML, and we’ll discuss how those variables are initialized for you. Each object’s name is specified via its fx:id property. You can set this property’s ...

Get Java™ How To Program (Early Objects), Tenth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.