Tuesday Jun 09, 2009

Technically I'm on vacation this week so don't mention this post to my boss. I simply couldn't wait to blog about cool stuff we put into JavaFX 1.2. Shhhhh!

Lots of JavaFX related things were announced at JavaOne, many of them concerning future products and other bits that aren't released yet. This post won't cover any of those. There were so many things discussed at JavaOne that I'm afraid some of the key points of the new JavaFX might have been missed. In this post I'm only going to cover the things that you can actually download and work with today. I'm talking only about the new version of JavaFX, previously codenamed Marina, and now called JavaFX 1.2. Without further ado, here is my personal list of the most important features.

Top 5 Most Important Features in JavaFX 1.2

Linux and Solaris support

Support for JavaFX under Linux and Solaris has been a long time coming. It's always been in our continuous build system and we really wanted to ship it with the 1.0 release, but too many things were broken. Finally, after much hard work, we have a beta release. Our goal is to make Solaris and Linux equal platforms with Windows and Mac in the JavaFX world. JavaFX is about having one Java across all of the screens (Desktop/Mobile/TV) as well as all of the OSes (Mac/Win/Linux/Solaris). This is one more step towards that goal.

Some features still don't work, which is why we are calling it a beta release, but it's a good starting point. We are now using GStreamer for the video support, which was one of the key features previously missing. You will get some graphics hardware acceleration depending on your distro and configuration. Shaped windows do not work yet. This is due to a bug in the underlying JRE. The graphics guys say they have a fix which will be rolled out into Java 6 and OpenJDK soon, so you won't have to wait until the next release of JavaFX for cool rounded windows.

Controls and Layout

JavaFX has had great graphics but at the 1.0 release had only a single native UI control, TextBox. It's kinda hard to make a real business oriented application using only text controls. That's all changed now. JavaFX 1.2 has real UI controls, designed for the 21st century. We looked at everything we always loved and hated about Swing, and considered long term UI toolkit trends. Then we build a new control and layout API that addresses the kinds of applications people need to build today. Here's just a taste of what's in the new controls:

  • All controls are skinnable with CSS, so a designer can create a common look across all of your applications.
  • There is a new modern default look and feel, Caspian, designed to look at home across OSes and on mobile devices
  • Controls are in the common profile, meaning they will work on all devices, not just desktops.
  • New controls for standard features like progress indicators and the hyper link
  • All built on top of the JavaFX scene graph, so there are no remnants of AWT.

Along with the controls is a new layout system that addresses the biggest problems with the AWT layouts. It is now super easy to mix layout with animation, and to create custom layouts using only a few lines of code. With controls we can build real business applications that run across multiple screens.

There are a few controls missing from the current list. In particular you will notice the absence of Table and Tree. It's not that we don't have plans for them. There simply wasn't enough time and we didn't want to hold back the release. Rest assured they are coming.

Charts

Along with controls the most important feature for building business applications is charts. Charts are such a common request that we built them into JavaFX. All of the standard chart types are there, including pie, scatter, and bar charts. They are very easy to use and customize. You can also create your own chart types using a few lines of code. Here's a few examples.


Data: Persistence, RSS/Atom, and Tasks

Previously you could work with data only by dropping down to Java code. This would be fine except for the fact that mobile Java code is different than desktop Java code. In addition, every form of Java has it's own special API for persisting data. To fix this problem we've added new support to JavaFX common profile to hide these kinds of platform differences and let you get back to coding great apps. Here's a quick list of the new stuff:

  • javafx.io.Storage for persisting data locally on any client platform
  • javafx.data.feed.* built in support for RSS and Atom data feeds
  • DateTime, Math, and Properties as JavaFX classes
  • javafx.async.* base classes for all asynchronous operations in JavaFX, including a clean way to implement Java based tasks

Speeeeeeed

Our goal is for every updated to JavaFX to be faster, and I think we definitely hit that goal. Across the board you will find JavaFX 1.2 to be faster than 1.1 and 1.0. In terms of startup time, memory usage, and graphics performance we have improved every part of the JavaFX user experience. For certain tasks you will see as much as a 3x improvement over the previous release.

To achieve this speed improvement we revisited almost every part of the platform. The compiler switched from using true multiple inheritance to mixins. This eliminates most of the nasty corner cases that gave multiple inheritance a bad name while providing what developers want 90% of the time. As a side benefit the underlying compiled bytecode is smaller and faster.

The graphics team did a lot of work redesigning the scenegraph to handle updates to the scene more intelligently. The result is fewer repaints and a more responsive user interface.

There were also bug fixes across the board to the video & audio stack and the underlying graphics pipeline. In addition, we put a lot of work into JavaSE 6 update 14 to reduce startup time and improve webstart performance. Over all you will find JavaFX 1.2 to be faster and smoother than the previous releases.

Just the beginning

The five features I listed above are just a small part of the many improvements in JavaFX 1.2. What's most important is this is part of a larger plan to have regular smaller releases of the JavaFX platform rather than the huge 2+ year release cycles of the JRE. Faster and smaller releases ensure that we ship high quality software to you faster, and lets us better incorporate your feedback. If there is any feature you feel is missing please send us a note or file a bug at javafx-jira.kenai.com.

Back to vacation for the week and then time to dive into the next release. Please let us know how you like JavaFX 1.2 and what you are are building with it.

Comments:

You are too late for have these component, we spend lots of time to build them by myself in the JavaFX1.1, Saddly

Posted by 210.22.148.211 on June 09, 2009 at 06:06 PM PDT #

Features look absolutely awesome. Keep up the great work!

Posted by Mass on June 09, 2009 at 08:59 PM PDT #

Great work.
Any easy to understand road map anywhere? I wouldn't mind seeing what's being added to 1.3?
I'm glad you going to get releases out quicker.

Posted by Zammbi on June 10, 2009 at 12:11 AM PDT #

Great work.
I'm just waiting for a standard way to integrate JavaFX into my Swing apps... I don't like to use some "hacks" to do that.

Posted by Gilberto on June 10, 2009 at 05:31 AM PDT #

The controls are a step in the right direction, but until there's a decent way of integrating JavaFX into STANDALONE desktop apps count me out. It seems that JavaFX is geared toward RIA and has completely bypassed desktop app development. JNLP is not an acceptable startup method for a standalone application. Inability to bundle all required libraries with a distribution (so it installs and runs out of the box) is also a HUGE drawback.
JavaFX is a fantastic tool, please please please integrate it more with existing Java infrastructure. Right now it feels entirely separate from Java 6

Posted by themike on June 11, 2009 at 02:47 AM PDT #

@Gilberto,
There is a standard way to integrate Swing into JavaFX using wrappers. You should forget about integrating JavaFX into an already made Swing application, you're not supposed to use both Java and JavaFX for UI.

@themike, I think you misunderstood the idea of JNLP and also JAR files for that matter. You can bundle all your libraries in your application's JAR file. JNLP is the best way to distribute your application. A very small file that you can provide to your users for download. When running the file, JWS will download your JAR file which include your libraries, it will install the file and put shortcuts then it will run it, as simple as 1-2-3. The whole idea of JWS is to ease the distribution and installing Java applications (with their required libraries) to end users, and you will get the same experience at any platform. Besides, the upcoming Java Store will allow you to distribute JavaFX application even faster and easier.

JavaFX is not meant to be coupled with Java. It's scripting language that can take advantage of Java and you can easily integrate your java code with your javafx code. If you haven't tried JavaFX, I encourage you to do so because I was skeptical like you before I tried it, you have to try it to see what's the idea of JavaFX and you will have a lot of fun believe me :).

Posted by Maan on June 12, 2009 at 08:41 AM PDT #

It's very nice to finally have a set of Controls, but could you release a detailed documentation of how to build your own skins? Actually it would probably be enough with the com.sun.javafx.scene.control.caspian.*Skin code if it's possible to release it or parts of it.

For example I would like to add an icon and perhaps a checkbox to a ListView item. Currently the items' presentation are just toString(). Doesn't seem like it would be too much work to return a Node instead, but right now it seems that I would have to work backwards from the known public attributes of Skin. Just having a piece of example code for each Control's Skin code would therefore be great.

/Regards Pär

Posted by Pär Dahlberg on June 12, 2009 at 02:53 PM PDT #

When will you post javafx samples on the blog instead of screenshots. I think it is time to see the real code on blogs.

Posted by Adam on June 24, 2009 at 10:01 AM PDT #

ehhmmm..

> @Gilberto,
> ... You should forget about integrating JavaFX into an already
> ... made Swing application, you're not supposed to use both
> ... Java and JavaFX for UI.

Until this attitude is resolved, the obvious marketing spin of a "rich and vibrant" JavaFx community will stay a lie. How many times can you trot out TweetFx and claim it as new.

Meanwhile, Kirill Grouchnikov is schooling all of you with Trident. He's one dude, and already Trident looks better and more useful the entire JavaFx stack (media decoding excluded, although, VP6.. really? who made that call?)

Maybe I'll try my hand at JavaFx to make crickets_wav.loop(forever) - That can be the soundtrack to the "Java Store"

Posted by Adam Malter on June 24, 2009 at 06:53 PM PDT #

need a detailed documentation..
thank you

Posted by imezun on June 30, 2009 at 01:46 PM PDT #

I'm still waiting for a standard way to integrate JavaFX .. :(

Posted by elting on June 30, 2009 at 01:49 PM PDT #

At first: Great work! Keep on! :-)
What I would need most urgently: Reasonable integration into Swing and a way to create commercial offline applications with JavaFX.
For Consumers as well as for business customers web start/JNLP often is a problem (up to now) and therefore not the best solution. In many cases offline distribution is simply a requirement by the customer.
JavaFX would be a much more useful tool if it would not be tied up to JNLP! Actually, it offers very much that is needed in Swing UIs for years! An easy integration of JavaFX with Swing would not only make Java *the* platform for desktop software - regardless whether distributed online or offline. And please do not forget: online-only distribution or SaaS has still some way to go, it is not (yet) the way most of the customers and consumers think and want! But also, an easy integration of JavaFX with Swing could spead up the adoption of JavaFX enormously. It wouldn't be an "either or" anymore.
I think, very many people - developers, entrepreneurs and customers - woudl be very glad if you could move something into this direction.
Best regards, Robert

Posted by Robert Rohm on July 31, 2009 at 02:43 AM PDT #

When h.264 support? Silverlight 3.0 provides it powered by GPU, that's a killer features!
Regard, Andrea

Posted by VeniceAndrea on July 31, 2009 at 05:52 AM PDT #

I know that this entry is about top 5 most important features, but I would like to leave a comment about 1 important issue.

I think that JavaFX is an amazing technology, but it suffers with the class loading time. So, I think that this issue is the most important one to be fixed, in order to JavaFX to gain more market in web development.

Posted by Alexandre Verri on August 06, 2009 at 09:48 AM PDT #

Your're great! Keep on working

regards
dr from PL

Posted by Rumi on August 19, 2009 at 11:20 PM PDT #

Until this attitude is resolved, the obvious marketing spin of a "rich and vibrant" JavaFx community will stay a lie. How many times can you trot out TweetFx and claim it as new.

Meanwhile, Kirill Grouchnikov is schooling all of you with Trident. He's one dude, and already Trident looks better and more useful the entire JavaFx stack (media decoding excluded, although, VP6.. really? who made that call?)

Maybe I'll try my hand at JavaFx to make crickets_wav.loop(forever) - That can be the soundtrack to the "Java Store"

Posted by Adam Malter on June 24, 2009 at 06:53 PM PDT #
---------------------

i bet that's why sun went down. they really dont care what people want.

Posted by 222.221.253.122 on August 21, 2009 at 01:46 AM PDT #

there are also lack some important tools in javafx that are database connect controls and menubar,toolbar

Posted by Sartaj on August 22, 2009 at 08:21 PM PDT #

Great!!! Really! Table, Tree & ComboBox are missing. I hope they implement them as soon as possible.

Thanks,

Laszlo

Posted by Laszlo Sas on August 25, 2009 at 04:15 AM PDT #

Linux partialy implemented... JFX doesn't work on amd64.

Posted by kedar on August 27, 2009 at 12:56 AM PDT #

Hi
Can you please me
how can we show checkbox to a ListView item so that user can do multiple selection and send data to server.

Thanks in advance
Vikramm

Posted by vikram taneja on September 15, 2009 at 07:19 AM PDT #

Hi
Can you help in this.
Actually i have a arraylist which will be populated runtime that is after selection of a radio button this arraylist will be made and i have to show the contents of this arraylist in list view with check boxes withevery field so the user can do multiple selection and then i need to send this selected value to server.

Thanks
Vikramm

Posted by vikram taneja on September 15, 2009 at 07:23 AM PDT #

Hi,
Could you tell me, How Can I do reports like Crystal Reports in an application JavaFx Desktop?

Thanks

Posted by Rodrigo Bereta on January 05, 2010 at 08:41 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed