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

Next, select JavaFX Application from the Projects selector pane on the right, labeled with the red number
3, for step 3. We are selecting this because your pro Java 9 game is going to be a type of JavaFX API application.
You can read the description of each project type in the Description pane (shown as a red number 4) and finally
click the Next button to advance to the next dialog, which is shown as a red number 5 in Figure 6-5.
Remember that Oracle made a decision to integrate the JavaFX API (then libraries, now modules) back
in Java 7 and then in Java 8, and so a JavaFX Game is now simply a Java Game, whereas before Java 7 (in Java
6), JavaFX 2.0 was its own separate programming language! The JavaFX engine, which you will learn more
about during the next chapter, had to be completely recoded to be a Java 7 (and Java 8) API, or collection
of libraries (and now in Java 9 it becomes modules), in order for it to become the seamless, integrated
component of the Java 9 programming language that it is currently.
The JavaFX API will replace Abstract Windowing Toolkit (AWT) and Swing (UI elements), and although
these older UI design libraries can still be utilized in Java projects, they are normally used only by legacy
(older) Java code so that those projects will still compile and run under Java 1.02, 2, 3, 4, 5, 6, 7, 8, and 9.
You’ll be compiling and running this new JavaFX API–based project that you are creating during this section
of the chapter, so you will see JavaFX is running under Java 9. The current version of JavaFX is 9, because
Oracle made the version number match with Java 9, however, the classes are the same ones used in my
Beginning Java 8 Games Development book.
Notice there is a Description pane underneath the other panes that will tell you what you have
selected will give you. In this case, that would be a new Java application with enabled JavaFX features,
where “enabled” means that the JavaFX 9 API libraries will be included (and started) in the Java application
project’s class and methods, as you will soon see in the code, via a series of import statements. You will learn
what all of this Java 9 and JavaFX 9 code does in Chapter 7 , which will cover JavaFX 9 and its many user
interface design and multimedia-related features.
Click the Next button to advance to the next dialog in the New Java Project series of dialogs, which is
the Name and Location dialog, as shown in Figure 6-6. This dialog allows you to set an application Project
Name, which will be used to create both a Class Name and a Package Name, as well as where you want the
project stored on the hard disk drive, using the Project Location and Project Folder data fields, which are
also shown in Figure 6-6.


Figure 6-6. Name the project JavaFXGame, and leave all other naming conventions the way NetBeans
set them

Free download pdf