Home > Java > Spreading some JavaFX love

Spreading some JavaFX love

I’m not a big fan of JavaFX: version 1 was just a huge failure, and investing in fat-client architecture in 2013 is either because you have very specific needs or are completely out of your mind. Nevertheless, I wanted to write about fat-client testing in “Integration testing from the trenches”, and JavaFX is the Java way for fat-client GUI.

So I was searching for some easily available application I could take as an example when I stumbled upon the Ensemble samples project from Oracle itself. Sources are available so I thought this could be a good match. Nothing could be further from the truth, the project is plagued by pitfalls:

  1. It seems the good people at Oracle had to choose between promoting NetBeans and JavaFX and their priority was on the former. Sources are available in NetBeans format. Tough luck if you don’t use it as your IDE…
  2. NetBeans uses Ant as its underlying build tool. Not only are Java sources and binary resources stored in the same directories, you have to read carefully through the build file to tweak some things.
  3. The code itself distinguishes between running from sources or from JAR. In the former case, it uses a text file listing all the desired samples to include, but it is built by the Ant build, and if it’s not present (or empty), you get a not-so-nice NullPointerException.
  4. Even worse, though JavaFX runtime is included in JRE 7, it isn’t on the classpath.

I think that putting such obstacles in the way of developers is hardly the thing to do to promote a technology. In order to fix those problems, I decided to tackle this heads-on, so I’ve created a Maven project. I changed no code, just moved resources around to adapt to the Maven standard project structure and provided the required text file.

The whole project is on Github, you’re welcome to give it a try!

email
Send to Kindle
Categories: Java Tags:
  1. November 26th, 2013 at 18:41 | #1

    Hi Nicolas,
    This is exactly the sort of thing I have seen many many times in demos for JavaFX, especially from Oracle. They seem to want to force Netbeans down everyones neck. They should realize that a lot of people don’t use Netbeans and don’t want to install it just to run a demo. They must lose a lot of people like that. I am not saying that they should make demos for me in Eclipse, I am saying they should make things generic. I really fear that adoption of JavaFX will suffer for this.

  1. No trackbacks yet.