At yesterdays keynote at JavaOne, Rich Green announced JavaFX together with Chris Oliver and James Gosling.
At the keynote, it was actually pretty unclear what it was.. It seemed smart, it seemed glossy, it looked like something everything should look like, it looked like a new web framework, it looked like a new language, it looked like a new mobile profile for Java - perhaps even a replacement for Java ME - it looked very easy (it always does at keynotes), and it sure looked a lot like Apple's iPhone (well, only the mobile part).
That is why I didn't blog about it yesterday - I wanted to know more about what it actually is, and in the last 24 hours I've become a little more knowledgable - knowledge that I will share with you now ;-)
JavaFX is a new product, which has many similarities to Adobe Flex. In that way JavaFX can be seen as the mediator for letting the Java platform (re-) conquer the market for graphically rich and compelling user interefaces for the desktop, mobile and the web.
JavaFX runs on every deskop with Java SE (version 5.x+) unmodified, which is nice. With todays performant mobile devices such as phones and PDA's, it should run on those as well. I haven't yet seen any details on what specs such a mobile device should have, to run JavaFX without any trouble, but I haven't had the time to look into all documentation yet.
In other words; JavaFX is all about being able to quickly and easily create modern, compelling graphical clients, which are hardware agnostic, runs on any device and automatically fits the constraints of the screen, hardware features etc.
JavaFX Script
JavaFX comes with this new language, to make it easier and much faster to create those compelling user interfaces. JavaFX Script is this new language, and should not be confused with JavaScript, or Java for that matter. The language itself has been developed almost 100% by Chris Oliver. It's focus is - not surprisingly - productivity.
JavaFX Script can be found on this URL: http://openjfx.dev.java.net/
I haven't been able to get a clear answer on why Sun choose to create a new language for such. From my point of view, it should have been possible to use languages like Groovy, JRuby or even JavaScript to accommodate the productivity, in combination with a nice Java API.
But JavaFX Script is statically typed, and is indeed a tightly focused DSL, so the reasons might be;
- that Sun wanted the language to be focused on this thing only (which should make the task of marketing the language a lot easier)
- that Sun initially wanted the full control of the language, or
- that none of the other languages fit in the demands for JavaFX
I don't know enough yet to be able to see which reason is the right one. Or maybe even see the correct reasons.
Anyways - the language seems alright. Until now I've only seen 6 lines of code. For what I saw, it looked a lot like a UI configuration language, with dynamic additions, but time will tell.
I asked one of Sun's engineers about the similarities of Adobe's ActionScript and JavaFX Script, and the answer was, that the domains for these languages are the same, and the functionality, the purpose and the use of them are also pretty much the same. But JavaFX has a more Java like syntax (no wonder), and as mentioned earlier, is statically typed.
Later I attended a press conference with James Gosling. He confirmed that Flex and JavaFX is quite similar in many ways. But he stretched that the advantages of JavaFX over Flex are numerous, because you have immidiate access to all of the ordinary Java API's for security, system integration, I/O etc. In my oppinion this alone is a VERY good reason for a Java developer, to wanna have a look at JavaFX instead of Flex.
As of now JavaFX Script is an interpreted language on top of the JVM, and creates its user interfacs using Swing. Later there will be made a compiler (according to a Sun engineer I spoke to).
JavaFX Mobile
I haven't yet seen much detail on JavaFX Mobile, but the keynote included a somewhat succesful demo of JavaFX on a couple of mobile devices, and it looked very nice! In general the user experience resembled that of the Apple iPhone. It seemed a bit slower though, but it isn't finished yet, so I guess the performance will be improved quickly the next ½-1 year. We saw also, that the same JavaFX application automatically changed to the constraints of the screens of the devices used in the demo.
Furthermore Yahoo! demonstrated an application called Yahoo! Go, if I remember correctly, which used JavaFX. It actually looked very, very cool and responsive.
Whattabout tools?
As of today, there is plugins for both Netbeans 5.5, Netbeans 6.0 and Eclipse 3.2. So it should be somewhat easy to get started.
Can I see a demo?
Yes you can. If you've enabled Java Web Start, you can click on the following links. Note that Chris Oliver did the JavaFX version of the Tesla web site, in less than 3 days! Try and do that in standard Swing - ouch.. Well, I'm not a Swing expert, but it seems somewhat quirky to me ;)
The demos can be found here: http://openjfx.dev.java.net/#demos
When eventually I find the time to fiddle with JavaFX, I'll post a first-time review.
technorati tags:JavaFX, Mobile, Adobe Flex, Flex, Chris Oliver, James Gosling, Open Source, Swing, JavaFX Script