JavaFX 1.0 is a big disappointment

Posted by Sam

Sun Microsystems has been doing so much right lately that I had really high hopes for JavaFX. Maybe too high. JavaFX 1.0 was released this week and I'm not ashamed to say that I'd been looking forward to it for a really long time now. A couple of really great features for GUI development were included and I THOUGHT they were making the code simpler.

First off I'd like to mention a couple of features that I think are fantastic for GUI development. Mainly binding and triggers. They do just what they sound like. For example you could have a central set of variables, say for example a bunch of preferences. Then wherever you want to use those preferences you just bind to the variable. Presto - bango. Anytime that variable changes everybody that is bound to that variable changes. Saves a TON of coding. The second feature is triggers. That is when a variable changes you can act on the knowledge that it changed. It's like creating Listeners without all the coding. And lastly being able to create applets that live beyond the browser is pretty cool. A completely separate threading model and everything. Cool indeed.

So where was I disappointed? Primarily I feel like they took a HUGE step backwards with their JSON support. Originally the examples showed that you could just make a one line JSON request and turn it into a real object. Nice huh? Simple and concise. Just how that task SHOULD be. Have a look at the ridiculous examples of using JSON in the 1.0 release. They have like 30 lines of code that say if ("string" == "value") then variable.something = json.something. It's just ridiculous. This is a very Java way to do it and something that's driven me nuts for years. There are Ruby libraries that can create first class objects from JSON and XML. Flex can do it. Why can't JavaFX. It shouldn't require so much code to do something so simple. Especially when it was doing it that way to begin with.

I've been playing with Adobe AIR lately and it's highlighted a couple of other problems that exist with JavaFX and really Java in general. I know they can be worked around with Java but I don't know how they can be worked around in JavaFX. With AIR I get a real icon for my program. It also shows up in the task list with the name that I give it. This isn't the case with Java. If you've got multiple processes running it can be hard to know which one is which. It also reinforces the Java brand more than my brand. AIR in general just has much better integration with the host OS. There are work arounds for traditional Java programs but this really needs to be something that Sun builds into Java and especially JavaFX.

I had a program that I was looking forward to using JSON, bindings and triggers on but frankly after working with Ruby on Rails for so long I have zero tolerance for excessive, silly code. I really, really wanted to use JavaFX for this app but it looks like it's going to be done in Adobe AIR. **SIGH**

Tags: javafx air rant