Mar 02
2009

What's new with JavaFX?

Posted by Eric Bruno in JavaFXJava

EBruno

JavaFX (javafx.com), a rich client platform that makes building GUI applications for the desktop and mobile spaces quite easy, was launched as version 1.0 in December of 2008. Since then, there have been over 100,000,000 downloads of the tools and the SDK. And since JavaFX is integrated with Java SE (both JDK and JRE) it's ready to go on over 50 million desktops.

 

JavaFX is composed of the compiler, runtime tools, and libraries for graphics, media, text, and web service support. Its goal is to allow you to build one application with one set of source code that runs equally well on desktops, mobile devices, and TVs. A mobile emulator is included to allow you to target mobile devices with differing screen real-estate. One of the coolest features is the ability to embed JavaFX applications into web pages, and then tear them off the page and onto the desktop where they can live outside the browser. 

 

In terms of development tools, there's an excellent environment available as part of NetBeans 6.5 (http://javafx.com/downloads), and there's even a plug-in available for Eclipse (http://kenai.com/projects/eplugin). I've been working with them quite a bit lately and they work well. With JavaFX 1.1, released recently, there are now plugins and tools available for graphic artists, integrating with Adobe Photoshop and Illustrator CS3. There's also the new Media Factory that can convert media in many forms into JavaFX Scrip code, automatically. 

 

JavaFX Mobile

 

The overall goal of JavaFX Mobile is to provide a unified environment for mobile device manufacturers, as well as mobile application developers. For manufacturers, this means one runtime environment for all of their devices that work equally well, without the need to build many of the features that JavaFX mobile will provide. This includes filesystem support, GPS support, bluetooth, networking, graphics displays, and so on. It's not a far stretch to consider JavaFX as a mobile OS all its own.

 

For developers, once again, JavaFX Mobile provides a runtime environment that supports many of the same paradigms seen on the desktop. It also allows you to maintain one source code tree, where the runtime takes care of adjusting the display for you based on the target device's capabilities. This greatly increases the market for your Java desktop applications, as Java runs on literally billions of devices. 

 

In the future, I would expect to see JavaFX Mobile running on devices such as the upcoming Palm Pre, Apple's iPhone, Android, and Microsoft Windows Mobile, although support for these platforms have not been officially announced by Sun. I would also expect to see, based on what Sun is saying, that JavaFX Mobile will run on less-capable devices, acting as the OS itself. 

 

JavaFX Script

 

To be prepared, as a Java developer, you should focus on the language: JavaFX Script. It works with Java, and you can mix the two languages together. After some getting used to, you'll find yourself building rich GUI applications with little time, effort, and code. This separates it from Java Swing, which requires a little more effort and more code to accomplish many of the same things. Sun, however, is maintaining that Swing is not going away. This is a question I hear in the context of JavaFX versus Swing, and there appears to be room for both to coexist. Instead, JavaFX Script is focused on being an alternative to JavaScript, Adobe ActionScript, and Microsoft Silverlight.

 

For more information on JavaFX Script programming, you can check out the following resources:

 

-JavaFX Site: http://www.javafx.com

-Chris Oliver's blog: http://blogs.sun.com/chrisoliver/

-JavaFX: Developing Rich Internet Applications: http://www.jfxbook.com

 

As for the roadmap for JavaFX, I would expect to see some exciting tools announcements at JavaOne this year aimed at graphic artists and others interested in building rich media applications. After that, we should hear more about JavaFX TV.

 

It's an exciting time to be a Java developer, as it gets easier to build media-rich applications that run on desktops, mobile devices, and (in the future) TV. All we need now is a JavaFX Application Store that will target the billions of devices already running Java! How's that for market opportunity? Hopefully Sun is reading this ;-)

 

Happy coding!

-EJB



Comments (7)Add Comment
I think it misses the boat
written by ranjix _, March 03, 2009
First, IPhone is THE thing. Java on IPhone returns nothing interesting in a Google search. Also, the Flash for IPhone kind of closes another possibility for JavaFX.

Second, Android seems to ride the other "cool" (let's see how long it lasts) wave, which is Google itself. Sure, is Java based, but not JavaFX.
With the 2 above, don't see too much space to turn for JavaFX, maybe to fight the battle with Silverlight for the niche/Zune type of devices.

Third, after trying JavaFX (2 times, thinking maybe the first it/I was too immature), I found it being a weirdo. Sure, it replaces some Swing, but without knowing some Swing you don't get anywhere. On top of that, the declarative type of UI definition is not very "framework-able", which I perceive as being a drawback next to Swing. The only possible advantage of JavaFX over Swing is the "more" rapid UI prototyping and some effects which not sure had a place in the Java UIs in the first place. Maybe they do. Unfortunately, IMO the advantage is balanced by the new "scripting language" and by complicating the process. Also, not sure how seriously we should take the media in JavaFX, considering the previous (IMO) failed experiment, JMF.


So, if I had a choice, I would go the following ways:
- for small, light processing, "cool" web UI - JavaScript.
- for small, very graphical web UIs, Flash.
- for heavier apps on the client (processing + storage), a standalone or a web start. I don't really see why a heavier app would be integrated in an HTML page.
Also, if I add GWT and Gears, I can see that heavier apps could be done just as well in JavaScript.

Finally, I absolutely fail to see the coolness of dragging an applet to make it a desktop app.

...
written by Eric Bruno, March 04, 2009
Thanks for the comments. You're certainly entitled to your opinion, but let me clarify a few of points. First, Java is running on far more mobile devices including cell phones than there are iPhones in the world. Having a unified, rich, common Java-based platform for those devices has been desired for some time by developers and handset manufacturers. Second, Android does not use Java. It might appear to be Java, but it's not. This is admittedly more of a legal issue, but it does introduce fragmentation that can be a developer's nightmare. Third, you don't need Swing knowledge to work with JavaFX. Forth, some companies prefer to use a common programming language and platform for ALL of their development. It's nice to have choices, but having to hire programmers that are experts with JavaScript, Flash, Swing, and HTML can be either impossible or expensive. Instead of choosing different technologies for different types of jobs, as you would, many prefer to be able to do it all with one technology. JavaFX allows you to use and expand on your Java knowledge in place of JavaScript, Flash, and GWT, etc.

Finally, the coolness of being able to drag a JavaFX application off of a web page and onto a desktop is that it makes for an easy deployment. No install mess. I find that cool. Others might also.

All that being said, of course nothing is perfect, and JavaFX is no exception. Please continue to choose the technologies you like best. If you don't like JavaFX that's fine. But as a Java developer, I find some things about it interesting, and thought I should share it.
thanks for the comment
written by ranjix _, March 04, 2009
I'll keep it short:

Android is not "Java" in the same way that J2ME with the different profiles is not "Java" (different libs, different JVMs, same programming language). The fragmentation (not in the legal way) already exists. On the same line, I don't really see JavaFX being Java. The language is different, as simple as it might be, so you still need "experts" in various areas, just like you need with the JavaScript and HTML. Also, the development for desktop is different than the one for mobile devices, so again you need the different "experts".
Personally I would like to see that JavaFX succeeds where J2ME didn't, but one has to wonder why after so many years of J2ME, a device like iPhone doesn't support Java...
...
written by Eric Bruno, March 04, 2009
Excellent discussion, and good points. Time will tell, but JavaFX for mobile and desktop is supposed to be the same from a programming standpoint. We'll see, I suppose.

As far as I know, Apple is not allowing any form of VM or environment on the iPhone because they want to retain total control over the platform. Supposedly they're working with Adobe to get Flash support, but it hasn't happened yet so it could be a rumor. I don't have insight into any of this so I can only guess what's going to happen.
I'm bringing the discussion about iPhone..
written by ranjix _, March 04, 2009
because the safari on the iPhone is the only one (that I know) that succeeds in being usable without trying to retrofit the pages for the smaller screen (disclaimer, don't have an iPhone but my friends obviously do smilies/smiley.gif ). So, it looks to me like the whole focus of JavaFX goes in the wrong direction, as long as they even have a notion of "JavaFX Mobile", suggesting that is different than the "regular" one. So, as long as they don't completely hide that difference (don't ask me how, I would answer "intelligently"), there will be room for vast improvement. Right now IMO JavaFX attacks a superficial problem - "make the UI more accessible for designers" - when actually the problem is in making the UI better altogether. And it attacks this issue by inventing a new language. Great.
...
written by Bryan Kitts, March 06, 2009
Since then, there have been over 100,000,000 downloads of the tools and the SDK

100 million downloads of the SDK? It seems extremely unlikely that there are 100 million Java developers in the world. Where do you get this figure from?
...
written by Eric Bruno, March 07, 2009
100,000,000 downloads? From Jonathan: http://blogs.sun.com/jonathan/...00_000_000

Actually, he said runtimes, so I could have been more accurate. But at this point, there are more than likely the same.

Write comment
You must be logged in to a comment. Please register if you do not have an account yet.

busy

Get your FREE Subscription to Dr. Dobb’s Digest today!

Dobbs Code Talk Quick Poll

This time next year, your most important operating system (host and/or target) will be:

Look Who's Code Talking


Chuck Somerville
City: Dayton

John Duprey
City: Rochester

Prabhakar Karve
City: Indore

Mike Carrico
City: Magalia

John Keklak
City: Sudbury

Dhruva Krishnamurthy
City: Bangalore

Dobbs Code Talk Tags

.NET abstraction Ada Adobe Agile Ajax algorithm Algorithmic complexity ALM Analogical reasoning Android Anecdotes Apple Application Development AppStore Architecture and Design ARM Artificial Intelligence Artificial Life Assembler Programming Audio files AVX AWK Banking Bazaar Best Practices Blender Books Brain computer interfacing Build C C Programming C Sharp Cartoon Category theory Cellular automata Clojure Cloud Computing Cobol Cocoa Coder Of The Month Cognition as compression Collaboration Common Process/Frameworks Compilers Computational humour Computational narrative Computational politics Computer Science Computers in art computing pioneers concurrency Conferences Consciousness research Contest Contest140 contests CPlusPlus crime CSharp D Programming Data Centers Databases Debugging Delphi Deployment design Design Patterns Digital Signal Processing Distributed Django Documentation DSL dynamic language Eclipse EDA education Emacs Embedded Systems Encryption engineering Erlang Etymology Excel exception handling Facebook Financial computing Five Questions Flash Flash Lite Flex Forth Fortran Fraud FreeBSD Fun Functional Programming gadgets Games Gender Git gnuplot Go Google Graphics GUI hardware Heron High School High-Performance Computing History Holographic reduced representations HTML5 Humanity Humour Hungarian Notation Identity Inkscape Innovation Intel Interview iPhone J2EE Java JavaFX JavaOne JavaScript language engineering Legal lex LINQ Linux Lisp Literate Programming Logic Programming m4 Mainframes Make Mathematica Mercurial Mesh messaging Metaprogramming Microsoft MID Miscellaneous Musings ML Mobile Software Mobility modeling modular programming multicore Music MVC myblog Natural Language Processing Networking Neural networks newspeak Nokia numerical computing Object Rexx ObjectiveC Office Office 2007 Online spreadsheets OOP Open Source Openaccess publishing OpenBSD OpenSolaris Operating Systems Optimization Oracle Pair Programming Parallelism Concurrency Parsing Pascal Patents Patterns Performance Perl PHP Podcast Pop11 Poplog Privacy Processing Productivity Programming Language Implementation Programming Language One Programming language semantics Programming Languages Programming Style Project Management Prolog Psychology Public understanding of science puzzle Python QA Quantum Computing Quotes Rails Realtime recls Requirements Research practice REST Review RIA rich internet applications Robotics Ruby SaaS Software as a service Scala Schadenfreude Science fiction Screencast Scripting SD Best Practices Search Security Semantic Web Silverlight Snobol SOA social Social Networks Society for the Study of Artificial Intelligence a Software Development Methodology and Management Songs and poems Spending Priorities Spreadsheets SQL Startups Statistics Storage String pattern matching Survey Teaching Testing The Business of Programming The Dobbs Challenge The Future Theory Topology Transhumanism Travel on the Job Twitter Types Unix Upgrade Usability Use Cases USENET User Experience User Interface Design Version Control video virtual machines Virtualization Visual Studio Visual Studio Sponsored Post WCF Web Development Windows Windows 7 Windows Live Wireless WOA WPF X Window System yacc

Subscribe to Dr. Dobbs Newsletter

Email:
Dr. Dobb's Update
Delivered twice a week, Dr. Dobb's Update provides unbiased and objective news, commentary and technical features spanning the entire software development marketplace.

Latest Comments

Jonathan's Last Day at Sun
For the 8 years I worked there, it was fantastic. I worked there under McNealy and I have undying admiration for the guy. I only knew Jonathan periphe...
Implementing Thread Local Storage on OS ...
Back in the day, I did a fair amount of work with PThreads. Wonderful design. Some quirks, but basically really, really nice. Although I wrote a lot ...
More Technonecrophilia with Snobol One-L...
Yeah, It's probably identical except for the (embedded) copy number, I would think. Once it became freely distributable, the copy I've been distribut...
More Technonecrophilia with Snobol One-L...
There's a spitbol-3.7-win.exe at http://code.google.com/p/spitbol/downloads/list . I found it via Dave Shield's blog page http://daveshields.wordpress...
Jonathan's Last Day at Sun
Sadness.

The Latest From Our Member Blogs

How To Select Trainees
Written by Joel Wiesen   
01/27/10
Hiring the right trainee can be harder than hiring a trained programmer.  One approach is described at my website: http://www.aprtestingservices.com/business/lpat/
 
Technical Job Interviews
Written by Keith Kerlan   
01/20/10
What is the best way to interview for software developer positions?  I've been on both sides of the job interviewing table, but have been on the interviewee side of some not too  great inter
 
Timers/timeouts in multi-threaded event-loops
Written by Christof Meerwald   
01/03/10
The traditional way to integrate timeout handling (or timers) in (single-threaded) event loops was to just pass the appropriate timeout value to the select/poll/epoll syscall. While this works fine
 
C vs C++
Written by Issam Lahlali   
12/04/09
I think that the debate "C vs C++" will end when the two langages died, and each one have its advantages and inconvenients, the choice of one instead of another depend on the application c
 
Great Jobs at CISCO
Written by Brent Rogers   
11/30/09
Hello! I am a recruiter at CISCO. We have a number of great jobopportunities at CISCO right now. Please take a look at the job links listedbelow and please send me an updated resume if you are interes
 
OK Labs, ST-Ericsson, and the Mobile/Wireless Ecosystem
Written by Steve Subar   
11/17/09
Two weeks ago, OK Labs and ST-Ericsson announced the selection of OK Labs as ST-Ericsson's mobile virtualization partner. To earn this coveted position, OK Labs prevailed in a rigorous evaluation
 
C++ Ninjas Needed in Santa Clara, California
Written by Brent Rogers   
09/30/09
Hello! I am a recruiter at CISCO. Our PostPath teamin Santa Clara is building a new Email SaaS business at CISCO. We are looking forsenior developers with Zimbra expertise to help us accomplish this t
 
Fighting Fragmentation with Mobile Virtualization
Written by Steve Subar   
09/21/09
Last week Motorola and T-Mobile announced the launch of a new and innovative Android-based smartphone, the Cliq. This attractive, feature-rich slider handset happens to build on a chipset and firmware
 
Insights into Router Design: Unit Testing of Networking Protocols
Written by Rajesh Kumar Venkateswaran   
09/07/09
  Unit testing is a software validation methodology through which a programmer tests individual modules or units of source code. If the programmer has been responsible for developing a networ
 
Insights into Router Design: Implementation of Networking Protocols
Written by Rajesh Kumar Venkateswaran   
09/06/09
  Modern data networking consists of a large number of networking protocols, each of which has its own domain of applicability. Some run on end stations (also called hosts), some on enterp
 
Insights and Innovations in Networking
Written by Rajesh Kumar Venkateswaran   
09/05/09
Networking devices such as routers and switches have evolved quite a bit over the past years, both in the service provider network and in the enterprise. It is a challenge to build these devices, bo
 
reddit threads community
Written by Christof Meerwald   
08/30/09
I have just started a threads community over at reddit to cover topics such as multithreading, concurrency and parallel programming. Feel free to join if you are interested. -- cmeerw.org 
 

The Latest From Dr. Dobbs

DDJ