Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 11 ■ 3D SCene Configuration: uSing the perSpeCtiveCamera anD pointLight


The basic Java 9 programming statement structure for this method call, which contains two nested
object instantiations, will look like the following (initially; we will configure it further next) Java 9
programming structure:


uiLayout.setBackground( new Background( new BackgroundFill(Color.WHITE) ) );


This is shown in Figure 11-10, albeit with a wavy red underline under the BackgroundFill, as we will need
to use an Alt+Enter keystroke combination to have NetBeans import the BackgroundFill class from javafx.
scene.layout (package). This is also shown highlighted in blue in the figure as “Add import for javafx.scene.
layout.BackgroundFill,” which you will double-click to have NetBeans 9 write this import statement for you.


Figure 11-9. Click the Game Rules Button control to see whether the Instructions section is rendering correctly.
It is now black!

Free download pdf