Exercises
12.3 (Running the Welcome App) In Section12.4 , you built the Welcome app’s GUI and previewed it using Scene Builder’s Show Preview in Window option. Create an
Applicationsubclass—like the one shown in Section12.5.4 —to load and displayWelcome.fxmlin a JavaFX window.12.1 (Addition App) Create a JavaFX version of the addition program in Fig.2.7 . Use two
TextFields to receive the user’s input and aButtonto initiate the calculation. Display the results in aLabel. SinceTextFieldmethodgetTextreturns aString, you must convert theStringthe user enters to anintfor use in calculations. Recall that thestaticmethodparseIntof classIntegertakes aStringargument representing an integer and returns the value as anint.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access