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

12.04.2008
| 14940 views |
  • 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.

Tags:

Comments

Otengi Miloskov replied on Thu, 2008/12/04 - 3:56am

This article is very optimistic, I hope JavaFX success!, That could be a win win to Java. Lets see today how is it. But Sun please don't drop comitment to this project and try to keep Linux first class for JavaFX and continue to support Swing in the future for Java 7.

Manuel Lagoon replied on Thu, 2008/12/04 - 8:25am

Unfortunately I dont share the same amount of optimism. Most companies have very strict rule about which version of JRE runs on all the machines within the company. I have seen some of my customers still using JDK 1.4.2. JavaFX runs only with JRE 1.6 + and I don’t see these companies upgrade to 1.6 before 2011. Unfortunately they don’t have such restrictions for Flash or Silverlight. People can update easily without waiting for permission from the IT guys.

James Sugrue replied on Thu, 2008/12/04 - 8:49am in response to: Manuel Lagoon

That is certainly a good point. I'm happy about the opportunities that are there for developers to build interesting applications, but I guess with all new technologies we forget about technology restrictions in companies  - whether it's new JREs or getting the chance to use cool new libraries/frameworks.

On the other hand, by 2011 we'll all have worked out pretty cool ways to use JavaFX :)

Manuel Lagoon replied on Thu, 2008/12/04 - 9:09am in response to: James Sugrue

Being a java developer myself and having seen the improvement in 1.6, I really wish that the major comapnies upgrade sooner than later.

I cant wait for the Netbeans update to come out. 

James Sugrue replied on Thu, 2008/12/04 - 9:27am in response to: Manuel Lagoon

Yes - I'm also looking forward to the Netbeans update. One point about 1.6, since Update 10, it's got a much better footprint. Maybe companies will start taking the leap because of this..

Richard Osbaldeston replied on Thu, 2008/12/04 - 10:21am

As a long time client side Java/Swing developer I habour a number of reservations about the JavaFX Script approach and the lack of communication, scarifies made by Suns client team.. all been said before.  But also Suns ability attract web development shops away from Html/Ajax/Flash.. might help stop losing Java people to Flex - but the pool of client side Java developers has always been realtively small to start with. Wait to see how web designer sites pick up the news..

Agree over the JRE footprint, Suns download figures for 6u10 really don't tally with my experience - as a company our target platform has been dictated by our customers. Which is very much still 1.5 (J2EE default). I don't see that changing anytime soon as there little to benefit a server updgrade to 6.0 (but lots to lose in terms of re-testing & proving).

Looking at the site I couldn't see the licence details for JavaFX /Scenegraph in the FAQ? has this been changed from GPL?

Looking at the developer API I didn't see JWebPane, found them awkward to browse - just differenet from Javadoc I guess. Is the JWebPane/WebClient component in here? if so how to I extract it for use in Swing ;)

Dean Del Ponte replied on Thu, 2008/12/04 - 10:41am

I'm running a mac, so I don't have the latest Java 6, but most JavaFX apps appear to still run.  Problem is, I went to the JavaFX site and it was slllooooooooooooooowww... Tried to run a few demo apps... had to wait an average 30 seconds for them to start up then had to click two popups stating that I trust the application before it would run.  Once up and running, the JavaFX apps were sloooooooooooow.  I hope JavaFX does well, but hope will only get you so far.  My first impression is that JavaFX is a dud.  Maybe in another year or two I'll have Java 6 build 10 on the Mac, and if JavaFX is being used anywhere, it will run better.  Until then I'll be avoiding it.

JeffS replied on Thu, 2008/12/04 - 11:05am

It's nice to see an article/blog giving Sun kudos for a release of new technologies.

 It's also nice to hear good stuff about JavaFX.  Posters in these parts tend to be very pessimistic about JavaFX, Swing, and client side Java.  Heck, they tend to be pessimistic about JEE.  The only "cool" things for these folks are Spring, Ruby on Rails, and Flex.  They tend to reject anything coming from Sun, or standard Java, or a JSR, out of hand.

 As for me, I've been extremely impressed with what Sun, and standard Java, has been putting out the last few years - NetBeans, EJB 3.x, Glassfish, Java 6 u10, Java kernel, Nimbus, and now JavaFX.

I see JavaFX as a "must have" for client side Java in the modern market.  There has to be some sort of RIA play, no matter whether it's late to the party or not.  Also, it's very, very beneficial to have an API and declaritive script to develop/deploy across all platforms - desktop, cell/smart phones, settop boxes, browsers.  And to tie that into standard Java, which, as an overall platform, is eons ahead of Flash, and more complete annd cross platform than .Net, is very very compelling.

Guido Amabili replied on Thu, 2008/12/04 - 11:15am in response to: JeffS

+1

James Sugrue replied on Thu, 2008/12/04 - 11:44am in response to: JeffS

Nicely put Jeff.

You're right - it's a nice change to see a pro-Sun article :-) I've been guilty of bashing JavaFX myself, but as I've said in the article it sounds like it'll be great.

 

Richard Osbaldeston replied on Thu, 2008/12/04 - 11:59am in response to: Dean Del Ponte

Had the same issue with Windows XP and Java 6.0u10 so don't feel left out. Got sick of waiting and opened new tabs, eventually something asked me if "I trusted Sun" - now that is a question. Tired of my existential quandary I answered yes to both and nothing happened. However the JavFX site has since fallen over, so maybe it was just that.

Did note which I could access the site it looked kinda static for a new RIA, also seemed designed for 1024x768 screen - which some might point out as possibly shortshighted if anybody wanted to try the site demos from their mobile device.. unless they get a different site?

Richard Osbaldeston replied on Thu, 2008/12/04 - 12:05pm in response to: Richard Osbaldeston

Ah it's back again and they've added a video, are they listening to this thread?

Kevin Daly replied on Thu, 2008/12/04 - 1:08pm

NO LINUX YET!!! and no mention when Linux is going to be available... Many devices in the next few years will be some sort of Linux embedded device, Adobe has finally realized this and has made the Flash player a first class citizen for Linux, now Sun wants us to use their technology, but they don't have a linux version. I know it was mentioned as 100% commitment, but by when?

Cross platform is one of the primary reasons our company develops in Java, we want options, we are seeing adoption of alternative platforms. Now Java is behind the others, I might as well just go and develop in Flash/Flex now.

Andrew replied on Thu, 2008/12/04 - 1:28pm in response to: Richard Osbaldeston

Downloaded JavaFX SDK and could not find mobile samples also. All samples for Desktop.

 

JeffS replied on Thu, 2008/12/04 - 1:30pm

The Linux version is coming in early 2009, AFAIK.

 It's understandable, for the purpose of getting a 1.0 release out the door, Sun would start off with a Windows and Mac release, both of which are, quite honestly, much easier to target than Linux (and I'm saying that as a devout Linux user).

Also remember that Sun's support of Linux has been stellar over the last 2-3 years.  Java works great on Linux, it's faster on Linux than on Windows, Netbeans is fully supported on Linux, and in Linux repos, Glassfish is in Linux repos, and Java has been open sourced.  Sun has also been working with the likes of Ubuntu to get Java fully supported in the repos.

 Be patient.  Once the Linux version is out the door, it won't be a second class citizen.  It just takes time for all versions, and all features, of a significant new piece of software, to get out the door.  Remember, the JME version not yet out, but soon to come. 

And you made the example of Adobe putting their Linux version of Flash out at the same time as Windows and Mac.  That is only with Flash 9.  Prior, all Linux versions of Flash were released months after the Windows and Mac versions.   Linux users cried bloody murder.  But Adobe was making an effort, and their developers blogged about the difficulties of deploying to Linux - where config files are, where libraries are installed, which version of libraries are installed, which version of the kernel, which version of glibc, which version of gcc, which GUI libs (gtk or qt or whatever else), which version of X, and on and on and on.  Those are all legitimate concerns for those deploying to Linux.

But Adobe eventually got it all worked out and smoothed over, and they're now releasing their Linux version of Flash at the same time as Windows and Mac.  But it wasn't always smooth sailing.

 So give the benefit of the doubt to Sun.

Jilles Van Gurp replied on Thu, 2008/12/04 - 1:41pm

So, where's all the cool launch applications? How can you launch a revolutionary new UI platform and not have an extensive portfolio of mature, cool looking applications to show it off? Have actual real applications been written for this platform at all?

 BTW. nothing seems to actually work on this product page (running the autoupdated 1.6u11 since yesterday). This looks like a big fucked up launch so far. 

 

 

Richard Osbaldeston replied on Thu, 2008/12/04 - 1:52pm in response to: Jilles Van Gurp

> This looks like a big fucked up launch so far.

To be fair that'd be just like every new website launch then.

Richard Osbaldeston replied on Thu, 2008/12/04 - 1:59pm in response to: JeffS

Is Linux support coming before 64 bit Windows? Think yourselves lucky your not 64 bit Solaris then http://tinyurl.com/6qmrjj ..Oh what ever happened to WORA?

JeffS replied on Thu, 2008/12/04 - 2:04pm

I can't get to the JavaFX website right now.

 That's good and bad.

 Good:  Demand is exceeding what was expected, and servers are overloaded as a result.

Bad:  They were underprepared.

 

But it's a good problem to have, and it happens with a lot of things that have any popularity.  Try downloading the latest version of Ubuntu on the first day of release.

Andrew replied on Thu, 2008/12/04 - 2:40pm in response to: Jilles Van Gurp

Jilles,

You should be very patient :). I dowloaded JavaFX 1.0 SDK  and run DisplayShelfMobile example using 1.6u11 via Web Start. The cool "loading" animation (Java FX Loading) image was on the screen for 2 minutes and 47 seconds. (I have Pentium 4 CPU 3GHz and 2GB RAM) I thought just like you that it never goes to run but decided to outwait it.  

 

   

Anonymous Coward replied on Thu, 2008/12/04 - 4:51pm

I've been having a bit of a play with this this evening and I've got to say its impressive. Sun seem to have made the on-line samples a bit tricky to find so in case you've missed them have a look here

http://www.javafx.com/samples/

 

Osvaldo Doederlein replied on Thu, 2008/12/04 - 5:48pm in response to: Andrew

[quote=andrew.g]

Downloaded JavaFX SDK and could not find mobile samples also. All samples for Desktop.

[/quote]

Check out Terrence Barr's blog. Short answer: the mobile samples are exactly the same samples used for desktop. Well, at least  some of the samples, I suppose that mobile execution requires proper adaptation to screen size and no usage of APIs exclusive to JavaSE. Still, quite impressive if you ask me.

Richard Osbaldeston replied on Fri, 2008/12/05 - 8:08am in response to: JeffS

> Good: Demand is exceeding what was expected, and servers are overloaded as a result.

Did have second thoughts about my expectations for any major new site to fall over. They might consider doing a public post mortem on the problems. It's the first major outing of the technology. If anyone else was considering using JavaFX to drive their application it wouldn't be reassuring that the JavaFX demo site and/or new version of Glassfish was going up & down after a couple of hours. The downside of eating your own dogfood is when you start throwing up later.

What was the issue? I might expect the demo jars via web start to place some unusual loads on the server. The JavaFX & 6.0u11 distributions seem to be external links to Suns distribution servers so it's not handling the really big downloads. Did they simply try running the whole deal on a single under-spec server? If the JavaFX runtime download for the demos was coming from their site server (?) that might do it.

Ugur Dundar replied on Thu, 2008/12/04 - 6:39pm

i really like to see a "visual designer" in netbeans javafx plugin. is there anyone knows when it will be updated?

Mike P(Okidoky) replied on Fri, 2008/12/05 - 11:33am

Weird rogue language. Mac support. No Linux. Do we have access to a Linux beta at least with partial functionality? Perhaps the video functionality and desktop install is giving them trouble. Given it's mostly Java and Java2D, should it be possible to run at least something on Linux simply by copying over a bunch of files? The Windows install is an exe and Mac install is a dmg. I feel that although it should be possible to run some of the stuff, it's purposely kept away from me - I'm highly disappointed.

PhotoShop and Illustrator plugins... Bringing Sun and Adobe closer together than ever before...
I wonder if, instead of having to export using the plugin, if it's possible to run a converter on the command line that could take an illustrator ai file and convert it instead.

All in all, a real substantial effort to get Java to do better on the desktop. I'm worried that it's not enough Java. I do take it that FX can access Java libraries seamlessly...? One could mix Java with JavaFX then.

Ok, so how do I get any exposure to it. I have Linux, no Windows, Mac is occupied by the wife. Wife's Mac is a 32 bit Intel MacBook - so no Java 1.6. Now what?

Richard Osbaldeston replied on Fri, 2008/12/05 - 11:44am in response to: Mike P(Okidoky)

Think the Java Plugin (Java Web Start) registering mime types etc.. is also a sticking point. These bits fall outside the OpenJDK and missing from 64 bit distributions. Others have got JavaFX 1.0 running via manual install / invocations under Linux right now. I'd Google for them I'm too damn nice (don't tell) http://www.weiqigao.com/blog/2008/12/04/using_javafx_1_0_on_linux.html

Mike P(Okidoky) replied on Fri, 2008/12/05 - 12:09pm in response to: Richard Osbaldeston

You *ARE* nice! I was just mocking with the dmg file on Linux myself and it failed to loop back mount using hfs or hfsplus, but with the instructions on that blog it works!

I went into the PathAnimation directory, typed 'firefox index.html' and 30 seconds later (long), I had a little car following the path of the road.

Then the question back to Sun: why did they just not make a partially functioning (no video I guess) for Linux?

Mike P(Okidoky) replied on Fri, 2008/12/05 - 12:15pm

Video sample plays http://capra.sfbay.sun.com/~jm158417/javafx_videos/big_buck_bunny_512x288_h264.flv

But doesn't work on Linux.

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?

 

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

> Wife's Mac is a 32 bit Intel MacBook - so no Java 1.6. Now what?

JavaFX works on Java 1.5.

Dmitri

 

Dmitri Trembovetski replied on Fri, 2008/12/05 - 12:49pm

Also, in case you haven't seen this:

  http://blogs.sun.com/javafx/entry/a_word_on_linux_and

Dmitri

 

Comment viewing options

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