Over a million developers have joined DZone.

Interview: "JavaFX Rich Client Programming on the NetBeans Platform"

DZone's Guide to

Interview: "JavaFX Rich Client Programming on the NetBeans Platform"

· Java Zone ·
Free Resource

Get the Edge with a Professional Java IDE. 30-day free trial.

The Anderson Software Group, Inc. (www.asgteach.com), consisting of Gail and Paul Anderson, is a company that specializes in training, writing books, and training videos. The training courses provide the feedback for teaching strategies and exposure to real­‐life software requirements that organizations have. That is used to help in book writing. 

Paul Gail

In this interview, we meet Gail and Paul, and talk about their latest book, which they will be releasing during JavaOne this year, JavaFX Rich Client Programming on the NetBeans Platform.

Hi Gail and Paul! Of the books you've written, which one are you happiest about?

Gail: Well, that's like asking you which child is your favorite! I suppose it is always the latest book, in this case JavaFX Rich Client Programming on the NetBeans Platform, since that is the one that we've been living, breathing, and dreaming about for months! But a close second is the Essential JavaFX book, since we managed to write that from conception to publication in just four months.

Paul: Yes, although that book was based on JavaFX script, much of the JavaFX concepts readily apply to the Java API version of JavaFX and enabled us come up to speed with JavaFX 8 quickly. Which then fed directly into the JavaFX portions of the Rich Client book.

You've now written a book on JavaFX and the NetBeans Platform. How do these two technologies fit together?

Paul: Extremely well! JavaFX has a nice scene graph metaphor that makes applying transformations easy. JavaFX takes advantage of modern GPU [graphical processing units] hardware and lets you create amazing UIs, including 3D. With FXML (markup language for describing a scene graph) and CSS, User Experience engineers can design UIs that Java programmers can use.

Gail: And the NetBeans Platform lets you build your application with modules. This is incredibly important because your application can evolve without creating a mess of undocumented dependencies. The NetBeans Platform also provides a window system, an action framework, and an inter-­module communication strategy. Then, with the Swing-­based JFXPanel component, you embed a JavaFX scene within a NetBeans Platform window.

We have used this strategy for several years now, and it works incredibly well. The book details how best to do this and the communication strategies you use to keep Swing and JavaFX code insular.

How is your book different than other books that exist on JavaFX? How is it different than books that exist on the NetBeans Platform?

Paul: We explain JavaFX in two chapters and use a third to cover integrating JavaFX into a NetBeans Platform application. We describe using JavaFX in desktop­‐type applications, with special emphasis on Swing programmers who want to move to this new technology. And many Swing programmers have missed having a Charts package with Swing, so we also spend an entire chapter on the JavaFX Charts package.

Gail: For the NetBeans Platform, we address architecting NetBeans Platform applications, leveraging the modularity, Lookup, Action, and Nodes APIs. It's really tough to learn about the different NetBeans Platform APIs in isolation. For example, you use the Action framework with Nodes, so an integrated example is important. Also, the NetBeans Platform expects certain “background basics” from its developers, such as JavaBeans properties and using background threads to keep the UI responsive. We cover these topics, even though they are not solely applicable to NetBeans Platform applications.

While our examples in the book have been simplified to emphasize the particular chapter's technology, we also developed a reference application that will be available on java.net. The application illustrates many of the book's concepts and emphasizes JavaFX integration in a NetBeans Platform application.

Click to enlarge the image above!

What are three specific things you learned (either about the technologies, about writing books, or anything else) that you learned while writing this book?

Gail: "Life is what happens to you while you're busy making other plans." (Attributed to John Lennon and others, so who knows?) But, when we originally planned this book it was due just before the release of Java 8 and JavaFX 8. Java 8 is such a significant release that we're happy that we waited. Lambda expressions greatly reduce boilerplate code, the JavaFX integration is enhanced, and you can even optionally run JavaFX and Swing on the same thread (this is experimental). Plus, we were given the opportunity to discuss JavaFX and NetBeans Platform integration at JavaOne in San Francisco, Russia, and Brazil.

Paul: But, for three specific things we learned, here they are:

  • We never want to write a large program again without modules. (Small teaching examples, of course, are okay!)

  • JavaFX rocks and we always choose to use it, if possible.

  • You can add JavaFX properties to JPA entity beans with correctly applied annotations (see Chapter 16).

What kind of developers would gain the most from this book?

Paul: Developers of sophisticated desktop applications who are interested in moving to JavaFX.

Gail: But if for some reason you don't want to use JavaFX, we structured the book so that the main NetBeans Platform APIs are explained without having to use JavaFX.

Two more images from the book:

You'll be at NetBeans Day and JavaOne -­‐-­‐ what are you planning to do there and which sessions would you recommend to attend?

Gail: At NetBeans Day, we are on a panel to discuss using the NetBeans IDE as a teaching tool, so Paul will use his classroom experience in teaching Java.

On Monday, we're presenting a tutorial on leveraging the NetBeans Platform and JavaFX integration [Hilton -­‐ Imperial Ballroom A, Mon Sep 29, 2014, 8:30 -­‐ 10:30AM].

Paul: Tuesday [3:30-­‐4:00PM] we have a book signing and rumor has it that Geertjan will join us!

Gail: Having Geertjan join us is a privilege for us, because you, Geertjan, were instrumental in planting the seeds of this book and introducing us to the great NetBeans community!

Paul: In terms of other sessions at JavaOne, there are several on JavaFX 3D, Adam Bien always gives an informative talk, there’s several on lambda and streams programming, and we plan to see how others are using the NetBeans Platform.

Gail: JavaOne is also great for gearing up for the latest features—we look forward to learning about modules and JDK 9.

Thanks for the interview, Paul and Gail, looking forward to the release of the book at JavaOne!

Get the Java IDE that understands code & makes developing enjoyable. Level up your code with IntelliJ IDEA. Download the free trial.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}