Dustin Marx is a software developer who enjoys identifying and using the correct tool for the job. In addition to writing software and writing a blog on software development, Dustin occasionally presents at conferences and writes articles. Dustin is a DZone MVB and is not an employee of DZone and has posted 236 posts at DZone. You can read more from them at their website. View Full User Profile

The Challenges of a JavaFX Reboot

  • submit to reddit

In Jonathan Giles's post An FX Experience Retrospective, he starts by looking at the history of JavaFX and focuses on "what has happened in the world of JavaFX" in 2011. I was highly skeptical of JavaFX prior to JavaOne 2010 (see here and here for examples), but started to think more positively about it after the JavaOne 2010 and JavaOne 2011 announcements related to JavaFX. One thing that has been a little tricky about learning JavaFX since JavaOne 2011's big announcements has been knowing for certain whether a particular resource on JavaFX applies to JavaFX 1.x or JavaFX 2.x. Reading the An FX Experience Retrospective post provided a different perspective on the risks and challenges Oracle and the JavaFX team has faced in making this major overhaul.

Giles writes in his post, "Another vivid recollection I have from JavaOne 2010 is the various reactions that people had of this news. It varied from those in shock at losing their favourite language, to those who said it was long overdue and was the right way to proceed with JavaFX." I was in the latter group, welcoming this change and I would have liked to see it happen even sooner. The ability to use JavaFX with standard Java language and APIs was a huge benefit in my opinion and finally gave credence to the pro-JavaFX argument to Java developers that "JavaFX is Java." The JavaOne 2011 announcements of making JavaFX open source and making it part of standard Java SE were likely less controversial for Java developers (who wouldn't want these characteristics?) and are also important to me in my renewed interest in JavaFX.

For developers just learning JavaFX, it can be a bit tricky to know if an online resource is for JavaFX 1.x or 2.x without delving into the article. The changes in JavaFX from 1.x to 2.x are significant enough that I generally don't want to risk confusion by reading JavaFX 1.x resources (though some have found value in reading JavaFX 1.x resources in preparation for using JavaFX 2.0). However, there are some clues that can help make it quicker and easier to identify which version of JavaFX is applicable.

It is most obvious that an article is about JavaFX 2.0 when it explicitly states so. I try to do this with my blog posts on JavaFX 2.0, though I'm sure I occasionally forget to do so. When an article or blog post does not state the version of JavaFX specifically, another good clue is the date of the resource. In general, it is usually safe to assume that anything written about JavaFX before late 2010 is about JavaFX 1.x and it is similarly safe to assume that most things written about JavaFX in 2011 or later are about JavaFX 2.x.

Another clue to watch for is discussion in a resource that includes JavaFX Script or FXML references. The former (JavaFX Script) was exclusive to JavaFX 1.x and the latter (FXML) is exclusive to JavaFX 2.x.

Some really good documentation on JavaFX 2.x has been made available recently. The JavaFX 2.0 documentation states the following about JavaFX 2.0 versus JavaFX 1.3:

JavaFX 2.0 is the latest major update release for JavaFX. Many of the new features introduced in JavaFX 2.0 are incompatible with JavaFX 1.3. If you are developing a new application in JavaFX, it is recommended that you start with JavaFX 2.0.

The JavaFX 2.0 documentation contains many newly written or updated articles and posts on JavaFX 2.0. This set of documentation includes What is JavaFX?, Getting Started with JavaFX, Working with the JavaFX Scene Graph, Introduction to FXML, Getting Started with FXML, and Using JavaFX Charts.

Books on JavaFX provide another perspective on the challenges associated with the major shift in JavaFX's vision. Most JavaFX books that are currently available were written for JavaFX 1.x. berry120 (who has also blogged on JavaFX 2) recently asked, Any decent books on JavaFX 2? As far as I can tell, the only JavaFX 2.x book currently available is Carl Dea's JavaFX 2.0: Introduction by Example (I hope to write a review of this short, recipe-oriented book in the near future). This book has a publication date (2011) and JavaFX 2.0 in its title, making it clear that it's on Java FX 2.0. With books, which typically have longer time between writing and publishing, even early 2011 publications dates might still mean a book on JavaFX 1.x. Another good clue with books is the price of used books in the Amazon Marketplace. Books on old and/or deprecated language versions tend to be very cheap.

Other books on JavaFX 2.0 are likely to come. Pro JavaFXTM 2 Platform A Definitive Guide to Script, Desktop and Mobile RIA with JavaTM Technology has an advertised publication date of 12 February 2012.

Carefully wading through online resources and selecting books to purchase is tricky for developers because of the major shift in JavaFX's long-term vision. Giles's post provides some insight into the even greater effort required within Oracle and the JavaFX team to make this major shift. As painful as the shift is, I believe this shift in vision coming at the cost of short-term pain provides JavaFX a fighting chance for a prosperous long-term future.


From http://marxsoftware.blogspot.com/2011/12/challenges-of-javafx-reboot.html

Published at DZone with permission of Dustin Marx, author and DZone MVB.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)



Thomas Nagel replied on Tue, 2012/01/10 - 7:38am

In a way the new JavaFX 2 can be seen as a Swing++ - and it should really replace, once finalized, the now rusty old UI-API.

We here see it as a replacement  for Swing, and hope that it will be completed and fit to be used this way in Java 8. It's been long enough we struggled with Swings defects.

The currently features seem quite near to be useful, some things people have gotten used to in JSF-Libraries for example, are still missing and should be completed.

A good IDE UI-design-tool is a must also. Let's see who is faster, Netbeans or Eclipse.


Regards from Germany,

Thomas Nagel

Carl Dea replied on Wed, 2012/01/11 - 1:37am


Thank you for mentioning my book "JavaFX 2.0 Introduction by Example". For those who are interested I've ran and tested the code for the latest version of JavaFX version 2.0.2 and things run great. I finished the book right after the time of the release during JavaOne 2011. All of the code is compliant and compatible with the latest production release. Rest assured there is no code examples relating to 1.x of JavaFX Script language.

Generally I wouldn't judge a book by its price and/or assume on things based on a publication date. I tracked things (releases) all the way to the end (trust me it'll be okay). If you have problems I will help you resolve them anyway I can. 

Maybe I should have named it JavaFX 2.x.


 Take it easy and I hope you enjoy the book. Let me know what you think.


 Carl Dea

Author "JavaFX 2.0 Introduction by Example"
co-Author "Java 7 Recipes" 

Dustin Marx replied on Mon, 2012/01/16 - 8:38pm in response to: Carl Dea

Carl, I have definitely enjoyed your book. It gave me the background I needed to jump into JavaFX 2.x and start playing with it. I plan to write a book review in the next couple days on my blog. Thanks for writing it! Dustin

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.