I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

JavaFX 1.0: This Could Be Something Special

  • submit to reddit

Today will mark the 1.0 release of JavaFX, and a rebirth for the Java platform. Up to now I've had some reservations about JavaFX, but after having the chance to talk to  Param Singh, Senior Director of JavaFX at Sun and John Birkey, JavaFX Architect - I really believe this will be something great.

Before I go into the details of what's included in this release, I'd like to explain why I think this release is so good. There has been a lot said about the fact that Sun can't compete with Adobe or Microsoft in the RIA space. I disagree - now developers have a choice to use JavaFX APIs or Java APIs. Together they're a much more powerful combination than other platforms. 

Nothing To Worry About 

I talked with John Birkey about my concernts about JavaFX. After all, I've been developing desktop applications for quite some time, a lot with Swing. I was worried that the JavaFX focus would be a bad thing for Java UI Developers.

"As a longtime member of the Java community, what I'm excited about with JavaFX is that we have Swing and JavaFX. Together it gives us guys who love Java the ability to explore big apps. It's 2008 and the web is different now and so we need to make neat things that are dynamic and high value media. Swing is the best 2D UI Framework. What's exciting about the two technologies is that we have this great SE platform and then we have JavaFX with all these high value media services. It's about beauty, it's about motion. The important thing is that JavaFX script is pitched at 'let's get something visual up quickly and make it easy and fun to tweak'. You can use the declarative syntax to get things going quickly."

It's easy to hook your JavaFX UI components to data. JavaFX Script allows UI developers to avoid long IDE cycles with lots of labourious UI code to write, and to stay in the present.It's a new play about motion and beauty and going back to the web in a neat way.

The team is unified, and the names you know working on Swing are working on JavaFX as well. Octavian Tanase heads up both the JavaFX development and the Java development.

The thing about Swing that's good is for building big apps. JavaFX takes a different angle – focussing on making it easier to write up your UI. Swing developers know how long it takes to tweak their UI's and will probably never tell their managers how much time it takes! JavaFX improves productivity and is a interesting new way to do things.

Setting Itself Apart From Other Platforms

One of the key points is the power of Java. If someone has a Java application they can add a JavaFX front to it and create a nice, rich interface. If you want to create a web-resident and desktop-resident application, you get the unified Java platform runtime to do it. Doing this with the competitior platforms is hard. I know there are desktop versions like AIR, but Java has spent 10 years on the desktop building the security model, the APIs. JavaFX is new on top of Java. The other platforms trying to build these complex models – Java is already there.

When you go to mobile the same story applied. Developers building ME applications need rich interfaces where there isn't Swing. So they struggle even more. Currently when you have RIA applications on a mobile platform, they sit away from the stack. Getting these applications to tap into the Bluetooth capabilities of the phone, or the core libraries and APIs, you find that it's difficult to combine form and function. With JavaFX you see that integration come together with the JSRs supported in the phone.


I hope JavaFX reignites the Java community, getting developers to do more. My hope is that everyone says “It's Java – and it's Java Doing Great Stuff”. I hope this brings the original client side vision that Java already has to fruition. Java is dominent in the desktop and infrastructure.

What Is In Java FX 1.0

There are seven major aspects that make up this JavaFX 1.0 release. This release works with Mac, Windows but there's 100% committment on a Linux version to follow.

The Runtime 

First up is the JavaFX Runtime for Desktop and browsers which consists of all the libraries that allow developers to use text, graphics, animation, the scenegraph, audio and video. The runtime will be packaged on top of JRE 6 Update 10. As the JRE is pushed out through auto-update, JavaFX will be distributed as part of that mechanism. The runtime leverages some specific features in the JRE to allow JavaFX to run in the browser. There's an updated version of the Applet architecture and an updated version of the browser plugin in the JRE already that allows JavaFX applications to be browser-resident.

A Javascript bridge is also being delivered  as part of the package that allows interaction between the browser DOM and the JavaFX object model. So you can do simple things like click on a thumbnail on the browser and play a video, or trigger an application - it really is bi-directional.


Beta Release of Mobile Runtime 

It gets better - a beta release of the JavaFX Runtime for Mobile is being provided. JavaFX has been architected to a common set of APIs - these are the basic APIs that allow an application to be portable between desktop and mobile. An abstraction layer is included in the runtime, allowing the applications to run on mobile and desktop. So the emulator allows developers to start testing their applications ahead of the full JavaFX Mobile release in 2009 that will provide the deep integration into JavaME.

JavaFX TV will be out in 2009, but there's no emulator yet – but the common set of APIs will set the foundation for bringing it across to other devices.

The Scripting Language

JavaFX Script, which we're all pretty familiar with now, is the language available as part of the platform.


Developer Tools

To help developers along you'd expect a Sun product to release a NetBeans plugin, but they are also delivering a plugin for Eclipse. Developers using Flex or Lazlo now have a choice of building applications in JavaFX, that have tight integration into Java.

“Developers now will be able to create Rich Internet Applications with the APIs that are in JavaFX, or the APIs they know and love in the JRE already such as Swing or any library. We now give developers the choice of mixing and matching the two sets of APIs to deliver a compelling experience.”


JavaFX Production Suite

Graphic designer who literally lives their life in Photoshop and Illustrator and it can be difficult for them to work seamlessly with their developer counterparts. JavaFX solves this problem by delivering plugins for Photoshop and Illustrator that allow designers, once they've created their assets, to export it using a menu item. Those assets are wrapped, including all the meta-data like the layers, into a JavaFX format.

The goal of the format is that each of the layers has a wrapper around it, so that when it is brought into an IDE environment the developer can work with the wrapper and animate that particular layer as a background, or animate a graphical asset on a path. It's actually two way. So if the graphical designer changes the colour of that asset, or makes other changes, because it is wrapped and once it has the same name, the developer and designer can exchange the asset without needing to re-import or re-encode. It's called the Designer – Developer Workflow .More functionality through the IDE and other design tools can be expected over time.


Video Codecs 

At JavaONE 2008 Sun announced an agreement with On2 Technologies, one of the codec providers in the Flash platform, to deliver video support in the JavaFX Platform. On2 have a range of products called Flix – they have updated that product line to provide support for encoding video in the JavaFX file format. They have a 30 day free trial of the Flix standard so that you can play around with it and start coding content in their format.

Set of API Documents, Samples, Tutorials

These will all be updated in the JavaFX.com website, which currently only has the preview release. Over 50 samples will be available on the website. A range of tutorials will also be available.

"We are serious about making Java the platform of choice, across RIA, across desktop, across mobile. And really bringing forth the power of Java, getting more people to use it through JavaFX."

Now the ball is in the developer's court. I'm looking forward to seeing JavaFX being utilized to create some really impressive applications. And no, I don't think that Sun are too late entering the RIA space - with 10 years experience on the desktop they have  real chance to make an impact.



Osvaldo Doederlein replied on Fri, 2008/12/05 - 12:56pm in response to: Mike P(Okidoky)


Is that a flash file I'm seeing? Does it embed a flash player to play video ???

Does that mean JavaFX can embed any type of flash content?


JavaFX introduces its own format, FLM, but that's just a subset of the FLV format. See the high-end specs here. I think the FLM format is just a convenient file extension for a FLV file that's limited to the encodings supported by FX (VP6 video streams and MP3 sound streams). BTW Sun gets their codecs from On2 (same provider of Adobe Flash)so the performance and quality should be similar. Sun promises higher quality codes for future releases, this probably means full FLV support (i.e., AVC, AAC etc.). I don't know about other features like metadata, Sun is owing use a full tech spec of FLM. Anyway, FX should be able to play most Flash videos out there. Which is a good thing, less dupe work for content creators, and ability to use existing software for video encoding.

JeffS replied on Fri, 2008/12/05 - 2:20pm

I've been looking at JavaFX at the JavaFX website, at the demos, code examples, etc.  And I just finished downloading it with the sdk and Netbeans integration.

So far, JavaFX is looking pretty killer.  I think it's a game changer, and in some ways has leap-frogged ahead of Flex/Flash and Silverlight.  At the very least, JavaFX is a huge shot in the arm for client side Java.

It's going to be a boon for Sun's Java business as well, and Sun's Java business is already pretty healthy, profitable, and growing.

Mike P(Okidoky) replied on Fri, 2008/12/05 - 2:22pm in response to: Dmitri Trembovetski

That blog message does make me feel better.

However - it doesn't do Sun's reputation any good, if they announce how they were going to support Java on the iPhone, and like 9 months (how long ago was it), no further mentions whatsoever. I won't buy any pda's, cell phones, unless it does *full* java anyway, none of that wonky j2me stuff. But that's a whole other discussion and I don't wish to distract away from JavaFX.

I *CAN* run JavaFX on the Mac. I just wish it was possible to do it in a more legitimate way by downloading from a cvs server and running an alpha/beta or something, instead of having to hack a Mac image. How strange, we haven't seen Sun and a Mac together in any official way, ever, and now we find ourselves hacking Sun's Mac images. What a world.

Guido Amabili replied on Fri, 2008/12/05 - 3:49pm in response to: JeffS


I did watch the samples and demos and I must say

I feel like 20 years younger when I started with my Atari ST watching the cool demos.

This is really nice for us java developpers.







Umberto Zappia replied on Fri, 2008/12/05 - 5:09pm

It's time to rock some JavaFx on the web!

Osvaldo Doederlein replied on Fri, 2008/12/05 - 6:06pm in response to: Mike P(Okidoky)


However - it doesn't do Sun's reputation any good, if they announce how they were going to support Java on the iPhone, and like 9 months (how long ago was it), no further mentions whatsoever. I won't buy any pda's, cell phones, unless it does *full* java anyway, none of that wonky j2me stuff. But that's a whole other discussion and I don't wish to distract away from JavaFX.


Sun never announced that they'd port Java to the iPhone platform. I only remember some Sun engineers blogging that they would like to do that, but blogs are clearly not official statements. And it's not happening just because Applet forbids it. (Their stupid, monolistic license terms forbids any kind of interpreter runtime, except their own like the JavaScript inside Safari.)


Mike P(Okidoky) replied on Fri, 2008/12/05 - 10:12pm in response to: Osvaldo Doederlein

Sure they did, it was all over the. One of many articles here: http://www.infoworld.com/article/08/03/07/sun-iphone-java_1.html

And here: http://www.infoworld.com/article/08/04/24/Sun-continues-pursuit-of-Java-for-iPhone_1.html

It doesn't matter anyway. These gadgets are more and more a dime a dozen. Soon, PC's will be minituarized enough that they fit in that format. The Clarion Mind comes pretty close (Intel Atom, Linux). Soon we'll have full Java in our pockets. I'm sick and tired of all this pussy footing around Java by these companies, but luckily, not for much longer. Might as well keep coding in normal Java, Java2D, jogl, etc. Better to invest in that than J2ME or some clunky way to convert J2ME code to Objective C, so you can shoe horn things through Apple's arrogance. Apple can milk it for what it's worth, but they'll have to do it without me.

I think it's safe to stick to Java, while the rest can waste their time with these temporary distractions.

replied on Sat, 2008/12/06 - 10:57am

Great news... It looks cool and I hope that it will be possible to run JavaFX on all Java ME enabled phones... I'm looking forward to its adoption on mobile phones...

Jeroen Wenting replied on Tue, 2008/12/09 - 2:00am

Sun announced the intention to release an iPhone JRE but were thwarted by Apple's restrictions on software deployment and operation on the device which make implementing such a JRE impossible.

Comment viewing options

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