Shashank has posted 15 posts at DZone. View Full User Profile

Yet another JavaFX review

  • submit to reddit

Matt Stephens has written a witty and caustic review of JavaFX on The Register. While its not uncommon for reviewers to rip apart JavaFx, Matt has a few interesting perspetives. The key points in his review (according to me) are as follows:

  • Sun takes a long time to get products out the door. (We all know that, don't we?)
  • Change of language syntax late in the game isn't a great idea
  • There is no XML decalarative support in a time and age when XML is widespread
  • The user is agnostic to the specific RIA toolkit as far as the UI works.
  • Sun talks about JavaFX at JavaOne and not otherwise  (Quite true!)
  • Developers are waiting for JavaFX to be ready for primetime. (Sun do something -- they will stop waiting and move on otherwise)



Published at DZone with permission of its author, Shashank Tiwari.

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



Chris Kent replied on Fri, 2008/06/13 - 9:42am

All fair points apart from the bit about XML.  The widespread use of XML alongside Java is precisely because Java is so bad for programming in a declarative style.  JavaFX fixes that.  Why would you use an irritatingly verbose document format to write programs instead of a purpose-built declarative programming language?  His trivial example looks fine but doesn't contain any code to perform actions, only declarative layout code.  How would he propose to encode that in XML?  XML makes a very bad programming language as anyone who's worked on a moderately compliated Ant build will testify.

Kevin Daly replied on Fri, 2008/06/13 - 9:46am

Enough Bashing JavaFX!!

It seems to be current fashion to bash JavaFX, the damn toolkit isn't even out yet!

Give Sun a fair chance on this technology, everyone is raving about Flex, Ajax, Ms.Not, while bashing Sun for trying to keep Java & the JRE fresh & current.

For those of you who are bashing it because it runs in the JRE, PAY ATTENTION! Part of JavaFX is a new plugin & JRE version that solves the problems with the old plugin. (Fast Startup, Better Browser integration, Video).

It's asinine that people & writers are reviewing JavaFX without even understanding what it really represents.

As far as stability & platform, The Adobe Flash plugin locks my browser up 4 or 5 times a day on Linux & 1 or 2 times on my Windows machine, how is this any better than the current Java plugin?

The Java platform is also a much stronger platform than Flash or .Net, with a much better VM and true first class multi platform support (something people forget with .Net).

As far as XML, I agree that Sun's decision to use a declarative, statically typed language instead of XML was the right one, much more readable and easier to maintain. If people really want XML it would be trivial to write an XML to JavaFX translator & contribute to it, FX is after all Open Source.

I'm no Sun fanboy, but FX with the new JRE is an honest attempt buy Sun to fix mistakes that were made with Java in the past, and Sun should be congratulated for finally making Java Desktop a reality.


Greg Brown replied on Fri, 2008/06/13 - 10:02am in response to: Chris Kent

I agree that XML is not great as a programming language, but it is an excellent tool for declaring the structure of a UI. As the author noted, both Flex and Silverlight work this way. Pivot is a new UI toolkit that offers developers working in Java a similar capability:

The author also notes that XML markup is not optional for Flex and Silverlight; however, it is optional in Pivot. If you want to create your UI entirely in code, you can do so. I imagine that it might even be possible to create a Pivot app using JavaFX script (although I haven't actually tried to do this).


Richard Osbaldeston replied on Fri, 2008/06/13 - 10:20am

> Sun talks about JavaFX at JavaOne and not otherwise

 Haven't you fallen into the same trap in posting this to JavaLobby? <grin>

Chris Kent replied on Fri, 2008/06/13 - 10:23am in response to: Greg Brown

I'm not sure I'd say XML is "excellent" for declaring the structure of a UI.  It's OK for it, but then again so is any hierarchical declarative format.  Why not JSON, or Groovy or Ruby builders for example?  XML still suffers from excessive verbosity and most definitely *not* being a programming language.

For programmers that like to create UIs in code then JavaFX looks like a decent solution.  You're working with code not XML and the language supports a declarative style much better suited to building UIs than Java's.  As a sometime Swing developer it really appeals to me.  And for designers who don't want to see the layout code it makes no difference if it's XML behind the scenes or not.  The tools will take care of that.  When they're available.  Which is another discussion entirely.

I think that XML is often used in the Java world out of habit rather than because it's the best tool for the job.  JavaFX looks like it's a much better tool for the job and I for one am glad.  If I never see another XML file it'll still be too soon.

Greg Brown replied on Fri, 2008/06/13 - 10:49am in response to: Chris Kent

The nice thing about XML is that, using an element's tag name, you can identify the type of the component to create, and then use the attributes to specify properties; nested elements easily translate to child components. This is how Pivot's XML format is defined, and I don't think it is terribly verbose; in fact, I find it pretty concise. 

Other options may also work well, although I'm not sure that JSON would be one of them. There is no equivalent of a tag name in JSON, so it might be difficult to specify what to create.

You could create a Groovy or Ruby-based loader for Pivot, if you wanted to. Unlike Flex and Silverlight, Pivot isn't tied to XML. The XML APIs are defined in a separate, optional library.


Maxim Zakharenkov replied on Fri, 2008/06/13 - 10:50am

I also not a big fan of XML. XML has same roots as HTML and mostly fits for document markup purposes. JSON-like syntax is more compact and better readable. For instance I still can not get used to XML in ANT and Maven scripts. The XML is used there because the tools appeared when XML had boom time. Why should the mistake be repeated? Regarding Java vs JavaFX there is another story of course. Sun could probably first focus on the Java plug-in and supporting components and APIs like Application Framework. And after that (may be) create some alternative syntax. This would made easier transition for Java developers (if any transition would be necessary). But anyway I wish all the best to them. The situation is not simple now and I hope they will find forces to push the technology forward. Doing absolutely nothing would be the worst thing.

Greg Brown replied on Fri, 2008/06/13 - 11:03am in response to: Maxim Zakharenkov

Sorry guys, but I have to respectfully disagree. JSON is great as a platform-independent data exchange format (much better than XML, IMO), but XML syntaxes work really well for defining layout - see my earlier comment.

Namespaces tend to add a lot of noise and can make some XML dialects seem a bit ugly. However, you don't have to use them. Well-designed XML 1.0 is pretty easy to read.


Maxim Zakharenkov replied on Fri, 2008/06/13 - 11:34am in response to: Greg Brown

Could you defend your point on this example:

<frame title="Die, Ajax! - Hello World" visible="true" />

To my mind here are multiple redundant things from the language perspecitive of view like:

- Duplication of "someroot" word <someroot> ... </someroot>

- There is no need for both "<" and ">" symbols it is enough with one like in JSON and JavaFX - "{"

- The visible: true is also more compact than this visible="true". There is no need for "

Mikael Grev replied on Fri, 2008/06/13 - 11:34am in response to: Greg Brown

XML is a data format, period. The reason we see it all the time is because developers is too lazy to make the tools to handle it. This is my humble belief. :)

Greg Brown replied on Fri, 2008/06/13 - 11:42am in response to: Maxim Zakharenkov

XML markup contains redundancies - there's no question about that. For data that will only be read by a machine, this may be unacceptable. But for human-authored content, it's not as big a deal.

As I said, JSON is a great format for exchanging data between heterogenous systems. The lack of a tag name makes it difficult to use in UI declaration, though. Does JavaFX use JSON syntax? How does it handle this?



Andres Almiray replied on Fri, 2008/06/13 - 11:55am in response to: Mikael Grev

Hear! hear! XML is useful no doubt, but there is no need to see it everywhere just because the guy next door is using it, there are other well known alternatives (JSON/YAML).

Maxim Zakharenkov replied on Fri, 2008/06/13 - 12:01pm in response to: Greg Brown

>But for human-authored content, it's not as big a deal.

I probably wouldn't agree with that. But it's a matter of taste of course. Just if I had a chance to create a new UI language I'd tried to avoid redundancies. I don't see the reason why should we keep them. I'm not for using exaclty JSON. Just JSON is good example that some language can be better than XML for some tasks. If you need a kind of "tag name" it's ok. I suppose that it can be supported without redundancy if necessary.


John Smith replied on Sat, 2008/06/14 - 7:59am

I think the discussion here is missing some crucial points.  The main one is that because JavaFX is coming along so slowly, it's going to end up another unused curiousity - like applets.

XML is being used in Microsoft's Silverlight product. I am not a fan of it, but its going to end up getting about 100 times more users that JavaFX ever will because its being supported and marketed. MS provides tooling which makes Silverlight easy to use - developers never touch the XML directly (or so they say). 

 I was a big enthusiast of JavaFX as the tool that would bring Java back to the client. But Sun is so far behind Flex and Silverlight that I feel foolish about it.

The problem here is that JavaFX is turning into another rocket ship. Its super cool, wow it'll let you do anything - if they ever get it ready for the real world.  Meanwhile the competition isbuilding automobiles: boring but useful and very easy to use.

I am already seeing my Java customers looking at integrating Silverlight with their Java server-side environments. The bad news is...its really easy to do. 

Greg Brown replied on Sat, 2008/06/14 - 9:47am in response to: John Smith


Sun is so far behind Flex and Silverlight that I feel foolish about it.


This is a big part of the reason that we created Pivot ( Admittedly, Pivot is a bit behind Flex and Silverlight in some respects (mostly in terms of handling media content), but I think it is a closer competitor than JavaFX. Pivot's widget set is actually already more capable than Silverlight's was when it was released.



Michael Schnell replied on Sat, 2008/06/14 - 11:28am

Let's face it: JavaFX is like trying to get blood from a stone - It's simply too late for a third tool beside Flash and Silverlight. If I want to create a cool GUI with nice effects I'd use Flash/Flex (or Silverlight if I'm a supporter of the "dark side" ;-).

I develop Swing applications now for about 8 years and I wish Sun would have concentrated it's efforts on enhancing and fixing Swing! But that's not the case. OK the new "JRE 1.6_10" is a nice thing but it still contains several old bugs and missing features. What for example about a context menu for a JTextField? It's still necessary to use the (five year old!) "WinlAF" extension to get a (mostly) Windows conform GUI...

 Sun should first do it's homework before going to the "playground" and play with the other kids!

Greg Brown replied on Sat, 2008/06/14 - 7:03pm in response to: Michael Schnell

I agree with you that JavaFX is a dead-end. But I think there's plenty of room for another toolkit, especially a Java-based one. I personally don't want to switch to ActionScript or .NET just because Sun has dropped the ball.


Michael Schnell replied on Sun, 2008/06/15 - 3:29am

Maybe Sun should simply try to make Swing as solid as a rock (fix all those open bugs regardless how many "votes" they have in the bugparade) and give the "coolness factor" back to it.

There are already some projects pointing in the right direction:

1. Scenegraph - Give it an Eclipse visual editor plugin to make it as easy as creating movies in the Flash environment

2. Nimbus - Great stuff! Create some really cool demos (Please not the boring "SwingSet"...) and several examples on how to create amazing custom controls for Nimbus. Show integration of Scenegraph and Nimbus to create custom control effects!

3. Swing Application Framework - Integrate it in Java 1.6.0_10. Don't wait for Java 1.7! This should have been part of Java a long time ago.

4. Beans Binding - How long do you want to wait until this is finally part of Java? Don't talk endlessly about it - Just act! Come on folks - I used this kind of stuff with Borland's Delphi in the mid 90s... And Swing still has not a similar technology as part of the standard.

Finally it's necessary to make it easy for new developers to get around the old Swing threading problem! It's simply frustrating when you create your first long running "Action" and find the UI "freezing". Using Swing for the first time has to be a "light bulb moment" for new developers (as "Visual Basic" or "Delphi" always was).

taranfx fx replied on Tue, 2009/06/30 - 6:23pm

JavaFX is catching up demand it seems.
check my blog post Why Javafx? how to Code. Benchmark Graphics,CPU, Memory

JavaFX is powerful!

Nmatrix9 Nmatrix replied on Fri, 2009/09/18 - 1:53pm in response to: Greg Brown

Hello Greg,

I can't believe I haven't ever heard of Pivot.  I played with the demos and it easily kicks JavaFX's ass in three important areas:  Speed, Look and Ass kicking Awesomeness.  Seriously why hasn't this framework been touted more?  I mean seriously Sun's JavaFX website looks like it was done on the weekend while this freaking awesome framework is left to obscurity.  Absolutely ridiculous.

Comment viewing options

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