28.04.2019 Views

[JAVA][Beginning Java 8 Games Development]

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 12 ■ Setting Boundaries for Your Action Figure in 2D: Using the Node Class LocalToParent Attribute<br />

Figure 12-10. Change the declaration statement for the StackPane object named root from a static modifier to private<br />

The next static variable down in the declarations at the top of the class is static HBox buttonContainer; and<br />

I am also going to change this variable declaration to be a private variable, using the following <strong>Java</strong> statement:<br />

private HBox buttonContainer;<br />

Let’s make sure that the <strong>Java</strong> statements inside of the .createSplashScreenNodes() method can still “see” or<br />

reference this buttonContainer HBox object, which as you can see in Figure 12-11, they can. I also clicked on the HBox<br />

object in NetBeans so that it showed me the object references throughout my code (this is a really useful feature that<br />

you should use to visualize how objects relate between different <strong>Java</strong> 8 programming statements inside of your code).<br />

This selected object highlighting is shown in your code inside of NetBeans 8 by using a yellow field highlighting color.<br />

262<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!