25.5.4 TipCalculator Class

When you created the Tip Calculator app’s project, NetBeans created two Java source-code files for you:

TipCalculator.java—This file contains the TipCalculator class, in which the main method (discussed in this section) loads the FXML file to create the GUI and attaches the GUI to a Scene that’s displayed on the app’s Stage.

TipCalculatorController.java—This file contains the TipCalculatorController class (discussed in Section 25.5.5), which is where you’ll specify the Slider and Button controls’ event handlers.

Figure 25.17 presents class TipCalculator. We reformatted the code to meet our conventions. With the exception of line 18, all of the code in this class was generated by NetBeans. As we discussed in Section ...

Get Java™ How To Program (Early Objects), Tenth 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.