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

The Navigator pane, shown on the bottom of the NetBeans IDE underneath the Files, Projects, and
Services panes, shows the relationships that exist inside your Java code structures. In this case, that is
the JavaFXGame class, the .start() method, and the .main() method, which we will be learning about in
Chapter 7 , after we learn all about the NetBeans 9 IDE and how to use it to create a Java 9 game project called
JavaFXGame, which we are going to do soon.


NetBeans 9 Is UI Design Friendly: User Interface Design Tools


NetBeans 9’s extensible plug-in capabilities support the design-your-UI drag-and-drop design tools for a
number of platforms, including Java SE, Java EE, Java ME, JavaFX, and Swing, as well as C, C++, PHP, HTML5,
and CSS4. NetBeans 9 supports visual editors that write application UI code for you, so all you have to do is
make the visual on the screen look like what you want it to look like in the game application. Since games use
the JavaFX new media game engine, NetBeans supports the Gluon JavaFX Scene Builder Kit, an advanced
JavaFX user interface design visual (drag-and-drop) editor.
Since JavaFX has the PRISM game engine as well as 3D (using OpenGL ES or Embedded Systems)
support, we will be focusing primarily on i3D for this book since I covered i2D in Beginning Java 8 Games
Development (Apress, 2014). The assumption for the book is that readers will want to build the most
advanced pro Java games possible, which would equate to 3D and i3D leveraging a JavaFX engine, which is
now part of Java 8 and 9 (along with Lambda Expressions). The most efficient way to accomplish this is by
using Java code and not a drag-and-drop code generator.
The fastest way to develop pro Java 9 games is to leverage advanced code and programming constructs
that the Java and JavaFX environments generously provide to you for your use in creating cutting-edge
applications. In this case, that would be pro Java games that contain powerful new media elements, such as
2D vectors, 3D vectors, digital audio, video, and digital images, assembled together as one single unified 2D
and 3D hybrid content creation pipeline.


NetBeans 9 Is Not Bug Friendly: Squash Bugs with the Debugger


There is a general assumption that applies across every computer programming language that the negative
impact to a programming project of a “bug,” or code that does not do exactly what you want it to, will
increase in magnitude the longer it remains unresolved. For this reason, these bugs need to be “squashed”
as soon as they are “born,” so to speak. NetBeans 9 has extensive bug-finding code analysis tools that
can be accessed using an integrated NetBeans Debugger. NetBeans 9 also supports integration with the
third-party FindBugs 3.0.1 project, which can be found on SourceForge.net, which is located at findbugs.
sourceforge.net if you want to download the stand-alone version.
These tools take the real-time “as you type” code correction and coding efficiency tools we discussed at
the beginning of this section of the chapter to the next level of advanced debugging.
Your Java code won’t be getting that complicated until a bit later in the book, so we will cover how these
advanced tools work when we need to use them in later chapters, when your knowledge base is a bit more
advanced.


NetBeans 9 Is a Speed Freak: Optimize Your Code with a Profiler


NetBeans also has something that is called a Profiler, which is one of the areas that the NetBeans IDE
overhauled in release version 8.1, as I pointed out in the “NetBeans Code Profiling” section earlier. The
NetBeans Profiler Tool will look at your Java 8 or Java 9 code while it is actually running and will tell you how
efficiently it uses memory as well as CPU cycles. This profiling analysis will allow you to refine your code
and will make it more efficient in its use of critical system resources, such as Threads, System Memory,
and Processing Cycles. This can become quite important for Pro Java 9 Game Development, as profiling

Free download pdf