Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1
Chapter 7 ■ IntroduCtIon to JavaFX 9: overvIew oF the JavaFX new MedIa engIne

If you look at the Scene class documentation, you will notice that there is a .setFill(Color value)
method that takes a Color (class or object) value, so let’s try that next. As you see in Figure 7-7, I called the
.setFill() method off of the Scene object named scene using a scene.setFill(); method, which NetBeans
lets me select from the drop-down helper.


Select and double-click the .setFill(Paint value) method and then type the Java 9 Color class name
in the parameter area (Color is a subclass of Paint). Next, type a period to bring up the constants contained
in the Java 9 Color helper class, as shown in Figure 7-8, and find and select a TRANSPARENT constant. As
you can see in the Javadoc helper pane, the ARGB color value is the desired #00000000.


Figure 7-7. Add a new line of code and type in the scene’s Scene object and a period to invoke a method helper
selector

Free download pdf