JavaFX 2.0: Making RIA with Java

JavaFX 2.0 looks to make rich Java web applications easier

JavaFXAs far as Rich Internet Applications (RIA) are concerned, the major player for the last decade has been Flash, and its successor Flex. Silverlight has had its supporters as well, and HTML5 is moving the ball forward from AJAX and CSS. And then there’s Java.

After a brief stint of popularity, Java applets fell out of style, and even sites that used Java in the back-end rarely used it on the client side. JavaFX, now in its second generation, is an attempt to bring Java back onto the client side, and Jim Weaver is a big fan. Founder of JMentor, Weaver thinks that JavaFX brings a rich programming environment to the client, he’ll be talking about that at OSCON later this month. He recently clued us in on why he thinks JavaFX is such a strong contender.

Can you give us a short history and description of JavaFX?

Jim WeaverJim Weaver: JavaFX came out in 2007. It was created by a guy named Chris Oliver, and it was introduced as a way to be able to quickly and intuitively put together rich client Java user interfaces. Developers in general, and the industry in general, rejected JavaFX primarily because it was a new scripting language. They didn’t want to learn a language, so it just didn’t get the traction that it needed.

After Oracle acquired Sun, they took a different direction with JavaFX. They abandoned JavaFX Script, the scripting language for it, and made JavaFX a set of libraries, APIs and run time. You code it in pure Java or any Java domain-specific language. That’s the focus now. The new version just got out of early access and into a very early beta in June, and it’s starting to get some traction with developers trying it and using it for smaller applications.

The argument could be made that with Flash/Flex so ubiquitous on browsers now, and HTML5 gathering steam, another RIA platform is redundant.

Jim Weaver: I have nothing bad to say about Flex. I think Flex has been a great rich-client environment, and they’ve done a great job with deployment of the run times, except for iPhone and iPad.

The reason why I don’t use Flex is because it’s not Java. It doesn’t have the millions of Java classes that are available out there and the richness of the native Java APIs. You find yourself having to use some bridging technologies. So that’s why I’m pushing for Java. But there’s nothing wrong with Flex. Flex is great.

I do see a lot of advances in HTML5. I think there’s a lot of misconceptions and expectations that need to be calibrated around what HTML5 is: rate of adoption, rate of compliance on different browsers, and that kind of thing. Fundamentally, you’re still talking about trying to make browsers an application execution platform. You’re still working with JavaScript and you’re still trying to shoehorn some technologies.

The mix that I’m shooting for would combine HTML5 and rich-client Java in a number of ways: it would be rich-client Java, web-started, that contains JavaFX APIs for its richness on the client, with a scene graph that contains UI controls, effects, animations and transformations. JavaFX has an embedded web browser component that you can use as part of the scene graph, and it’s adopting the HTML5 standard.

The other way of doing it would be the exact opposite, where you have a browser and it’s got an app that has JavaFX. I don’t like that as well because then you depend on the browser for your JVM and your Java execution environment.



Sign up for the O'Reilly Programming Newsletter to get weekly insight from industry insiders.
topic: Web Platform
  • Dominique De Vito

    JavaFX v2 sounds like a good release, because it mixes strengths of HTML and Java.

    Indeed, HTML is the juggernaut of our time, and SUN has paid a great price fighting it:

  • Jason

    I would have agreed a few years ago. However, I think HTML5 and JavaScript frameworks are the future. Unless embedding Java is seamless, which even Flash barely gets there, I don’t see it beating the seamless solutions that HTML5 and JavaScript are going to provide.

  • Jack

    I agree with Jason. There is no place for JavaFX in RIA space. The problem is not JavaFX. The problem is and has been JVM running in browser and Java deployment. Until that is resolved,nothing matters.

  • Tony

    Hi All,

    I have done a lot of work with Java for many years and last year won the Duke’s Award at JavaOne for my efforts. For me JavaFX still has a long ways to go before I can use it in a RIA. I work with Video, HTML, 3D mapping in a single RIA and JavaFX does not come close to what I can do with Swing and JNA. I have over 13 video formats I support and JavaFX has what maybe 2? Their html browser capabilities is limited and I can use the full capabilities of the browser under Windows or Linux and maybe Mac if I had one to test with.

    On the other hand I do like the Look and Feel that JavaFX has I just wish they had more controls like Swing has. They will get there but by that time it may be too little too late, again. I hope the JavaFX team does not stop though.

    Good Luck,
    Tony Anecito
    2010 JavaOne Dukes Award and Outstanding Developer Award