Pro Java 9 Games Development Leveraging the JavaFX APIs

(Michael S) #1

Chapter 6 ■ Setting Up YoUr Java 9 iDe: an introDUCtion to netBeanS 9


Figure 6-9 shows the NetBeans 9.0 build/compile/run progress bar, which will always appear at the
bottom-right side of your NetBeans 9.0 IDE during compilation. Also shown is the Output Pane, maximized
so we can see what the Ant build process did, which we will be taking a closer look at in the next section of
the chapter.
It’s important to note here that NetBeans 9.0 will compile your project code whenever you use a
File ➤ Save menu sequence or the Ctrl-S keyboard shortcut, so if you had used the Save feature of the
NetBeans IDE right after the bootstrap code had been created, you would not have needed to undertake this
compilation process, which I just showed you how to do manually, as this process will be done automatically
every time you save a Java game project.
Also shown in Figure 6-9, right above the Output Pane or window, is the .start() method in the Java code
editing pane or window. At the left is a minus icon with a square around it. This should be used to collapse
or hide the contents of this method. This is done simply by clicking this minus icon at the left side of the
code editing window.
A minus icon will turn into a plus icon so that a collapsed code block can be “expanded” (uncollapsed).
Now that we have looked at how to compile the project in NetBeans 9, as well as how to collapse and expand
the view of your logical method code blocks (logical functional components of your Java class) in your
JavaFXGame.java project’s code, it’s time to run this code and see if it works. If it does, we can proceed to
Chapter 7 and start to learn about the JavaFX API and what it brings in new media development power to the
Java 9 programming environment.


Running Your Pro Java Game Project in NetBeans 9


Now that you have created and compiled your bootstrap Java 9 with JavaFX game project, it is time to run or
execute the bootstrap code, to see what it does. As you have already learned, you can access the Run Project
menu item using the Run ➤ Run Project menu sequence at the top of NetBeans, or, as shown at the top left of
Figure 6-9, you can use the shortcut icon that looks like a green video transport play button. If you mouse over
this, you will get a pale yellow tooltip, showing a Run Project (JavaFXGame) (F6) pop-up helper message.
I will generally use the longer menu sequences rather than the shortcut icons when writing Java 9 and


Figure 6-8. Use Run ➤ Run Project (JavaFXGame) to build and run the project to make sure the NetBeans
IDE is working

Free download pdf