Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 9 ■ JavaFX 9 User InterFaCe DesIgn: the Front enD For Java 9 game DesIgn

Next, add your title for your OS window chrome by replacing the “Hello World” placeholder text from
the bootstrap code that was created for you in Chapter 6. I’m going to use iTVBoardGame to match the 3D
logo and add “JavaFX 9 Game” using parentheses to clarify to the user what platform this application is built
on. The code for doing this is shown in orange in Figure 9-21 above the .initStyle() method and should look
like the following Java statement:


primaryStage.setTitle("iTVBoardGame (JavaFX 9 Game)");


As you can see in Figure 9-22, we now have an initial application startup splash screen with logo,
background image, user interface button bank, and sectional title image layer. In the case of the splash
screen, this is “Welcome!”


Figure 9-21. Revert to StageStyle.DECORATED and add an iTVBoardGame (JavaFX 9 Game) title for your
OS window

Free download pdf