JavaFX Applets – Current State Of Play And Next Steps
JavaFX is a new (less than one year since release) software platform for building Rich Internet Applications. Having undergone three major releases so far within its first year, it’s rapidly approaching the point where people could reasonably expect it to be a viable choice for building real applications. That might be the expectation, but what is the true situation? I wanted to understand where JavaFX really is in terms of browser-based applets. So, I set up a small test on this blog to look at the critical issue of app deployment. I asked people to leave their findings in the comments. Thanks so much to everyone who took part – I certainly found the results illuminating. In this blog entry, I’ll report back the findings of the test and what these could mean for future development of JavaFX technology. I’ll also discuss what I think the potential sweet spots for JavaFX applets could be in terms of types of browser-based apps.
Why Applets Are Important – Augmenting Browser Functionality
Before considering JavaFX applets in detail, it’s worth a moment to step back and ask the question: why are applets important? Clearly, their reason for existing is to augment the functionality of a web browser. For example: to play audio or video; or to allow sophisticated graphics for video games or other apps with complex graphics needs.
Now, many people will argue that the JavaScript/HTML/CSS is on a trajectory such there will soon be nothing the browser won’t be able to do natively, and thus the reason for Flash, Silverlight and JavaFX applets will disappear. They may be right: not having to rely on browser plugins is an highly attractive idea.
However, life is rarely that simple, and the future might not be black and white. The truth is: future JavaScript/HTML/CSS represents strong competition for Flash, Silverlight and JavaFX. What the future ends up looking like, though, will depend on how the various technologies compete. There are battles to be had in: developer productivity for creating compelling applications; and application deployment etc.
Results Of The Test
Start-up Time – Observations
First the good news – if you’re lucky with your hardware/OS platform, and you have an up-to-date install of JavaFX, JavaFX applets can start in around one second. That’s a great result, and a huge improvement on where the Java platform has been historically.
However, what the test results really show is that the above case of super-fast start-up is very much about the future potential of the technology. It’s clearly not where the technology stands today. In fact, the frequently observed start-up times in the test ranged from 1 second to c. 45 seconds, with start-up taking even longer than this for some people.
The applet used in the test is a small applet, about 30KB in total. Thus download of the applet itself should not be a significant contribution to observed start-up times. So, what is the wide range of start-up times due to?
It turns out that there are two major determinants of the start-up time of a JavaFX applet: 1) The hardware/OS platform of the user – which determines which version of Java and the Java Plugin they can use; and 2) whether or not up-to-date jars for the JavaFX run-time are installed, or whether they have to be updated on-the-fly during applet start-up.
For users running MacOS X, the start-up time for the Java Plug-in is slow (perhaps 8 to 10 seconds), even on new hardware. On Windows hardware, the corresponding start-up times are between 1 and 5 seconds.
For users that don’t have the latest JavaFX jars installed, depending on broadband speed e.g. 2Mbps, 5Mbps, it will typically take between 15 and 30 seconds for the 14MB or so of data to be downloaded.
Clearly, those end-users of apps that are worst off are people using Mac OS X and that don’t have the latest JavaFX jars.
Rendering & Other Bugs
Certainly on both Windows and Mac OS X, there can be terrible rendering bugs in JavaFX applets when the web page in which the applet is embedded is scrolled. On Windows, sometimes the web-page stops rendering immediately after the embedded applet, so all content below the applet is lost. JavaFX applets don’t work at all in the Opera browser or in Safari 4 on Windows.
What Role Can JavaFX Applets Play Today?
The rendering bugs in JavaFX applets are sufficiently bad as to make applets embedded in web pages that are likely to be scrolled an unacceptable choice for developers. That rules out applications like fancy embedded graphs and charts or embedded video players.
The variation in likely start-up time for a JavaFX applet – anywhere from 1 second to 45 seconds – without a good way of communicating what’s going on to the user – mean that only categories of app where the user is prepared to wait 30 seconds or more for their application to start are going to be possible choices.
The above suggests that the sweet-spot for JavaFX applets today is for building creative, browser-based video games. The elegant JavaFX programming model should make it productive to develop interesting games on short timescales. As an example, here’s a preview of a neat JavaFX game called Pastello which is heavily inspired by the popular indie game, Crayon Physics (I really recommend clicking through to Pastello, by the way – it’s an impressive piece of work).
Driving next stage of JavaFX adoption
Casual games are, of course, an interesting and substantial category. However, if that’s all that JavaFX applets can achieve, I think we have to say they’ve been a failure. That’s because it will mean JavaFX applets wouldn’t have moved the Java platform forward – the truth is, regular Java applets have always been pretty widely used for browser-based video games.
How then, to drive the next stage of adoption for JavaFX applets?
Rendering bugs on scroll must be fixed in order for JavaFX applets to take off for visualization applications. The variation in start-up time means that users expectations must be managed. As a first step, it will be important to let the user know it might take up to 45 seconds for the app to start up if they’re on a Broadband connection, and even longer if they’re on dial-up. However, that’s very much a workaround. What are really needed are progress bars that can be shown embedded in the web-page (and styled by the developer) to indicate download progress. Indeterminate progress indicators – like the spinning animated gifs developers can use now – are useful; but they are a really poor second choice to determinate progress indicators for long JavaFX start-up times that will have to be accommodated for some time yet.
Conclusion
Hopefully, the JavaFX and Java SE teams have been aware of all the issues brought to the forefront by this test for some time; and they already have solutions in the works. If not, I hope they take on board the clear findings from this test, and the likely consequences for JavaFX adoption: that is, rendering bugs and long start-up times with no effective progress-indicator-style feedback will put a massive brake on developer adoption for JavaFX applets until these issues are addressed.
Asam Bashir wrote:
JavaFX needs to be successful as a viable alternative to Silverlight and Flash, far too many problems here with irregular patches and landmine of problems ahead with DRM.
I just don’t see how a merger with Oracle is going to aid this.
Apple has even more money in the bank now, whilst whole of Sun might not have been attractive to Apple, just the chunk of Java maybe the right kind of acquisition for future developments in the RIA field. Apple could use similar strategy it adopted for Webkit.
Posted 09 Sep 2009 at 5:53 am ¶
simon wrote:
Possible benefits of Oracle acquiring all the Java-related assets are:
- Oracle is a much stronger company than Sun. In principle, Oracle can afford to make bigger investments in Java and JavaFX than Sun could.
- If Oracle goes ahead and properly Open Sources JavaFX, it could make it more attractive for companies like Apple to increase investments in Java, and even do their own version of JavaFX tailored for Mac OS X and iPhone Safari etc.
- As far as Apple goes, the fact that Larry Ellison and Steve Jobs are big buddies could have an impact on the RIA world. Together, they might decide to take on Microsoft, Adobe and Google in that space.
All the above just possibilities of course. Oracle might go the other way and decide it has no interest in consumer-related technologies and just double down on Enterprise software and tools.
Posted 09 Sep 2009 at 10:45 am ¶
Mr X wrote:
Can’t see Apple being interested in JavaFX – they have a platform to promote.
Oracle on the other hand are constantly worried that the platform vendors ( in particular MS, but IBM also ) will use their platform control to drive them out of business. ie SQLServer running best on Windows, integrating better with other windows technologies etc – the more important Windows becomes the more worried Oracle becomes. This even extends to phones – if Windows mobile dominated would that put mobile Oracle applications ( salesforce or financials ) at a disadvantage?
So Oracle have both an interest in the general promotion of open standards ( outside it’s core area of business ) and the ability to supply the whole stack.
If the world developed applications in Java or open web technologies, that worked on many operating systems they would be breath a whole lot easier.
On the flip side the danger is that Oracle will be tempted to become a platform at the OS and development tool level now it has a real presence in these areas.
Posted 09 Sep 2009 at 3:23 pm ¶
Mr X wrote:
On the major thrust of the article – in my view if JavaFX is to succeed it needs to succeed *inside* the enterprise – which includes a *lot* of non-web deployment.
This is where most of Java client development actually happens. This is why integration with Swing is at the top of requests.
The other main area is in devices/appliances where people don’t realize it’s java – settop boxes, kiosks, phones, smart gadgets. Again web deployment is really not of interest, but speed, low resource usage ( and ability to make the most of the hardware ) and stability are key.
The key here is being able to change the hardware very frequently without breaking the software and deploy the same compiled code to multiple devices – something the Java platform is very good at.
Don’t get me wrong – killer web deployment would be nice – but it’s not at the top of my list. I want to be able to build a desktop app, that mixes Swing and JavaFX, is easy to deploy without external dependencies, runs at a decent speed, and saves me time ( not having to write basic components myself ).
I realize they want to go after new markets, however resources are limited and they are also kinda positioning JavaFX as Swing2 as well.
So in a way Larry and I share an objective – need something you *could* actually rewrite open office in.
In terms of web development – if I’m doing that then my focus is how well does my server-side code enable web development – for the client side – the clue is kinda in the name ‘web’ development. Again in theory the Java platform is well positioned in being secure, fast & scalable.
Gmail backend for example is in Java.
What they need to focus on is keeping the development cycle down to a minimum – I make a change – I can instantly see the effect.
Posted 09 Sep 2009 at 3:52 pm ¶
Asam Bashir wrote:
Apple may not be interested in JavaFX in the current state, but I’m sure it could make JavaFX into something useful for the Mac as well as other platforms. All those Java developers wouldn’t be a bad thing for Mac if they play by Apple rules and it would be silly of Apple to ignore threat of Silverlight/Flash exclusivity of RIA space.
A relationship at this stage between Apple and Oracle would be beneficial to both in the long run, Apple UI expertise combined with enterprise deployment and service from Oracle, the motivation, simple long term survival for Oracle, and increase in marketshare for Mac – lets hope Larry and Jobs get to have a chat together…
Posted 09 Sep 2009 at 4:33 pm ¶
Asam Bashir wrote:
Maybe even collaboration on the OS front, no reason why Oracle couldn’t use Open Source Darwin for some projects rather then trying to maintain it’s own OS.
Posted 09 Sep 2009 at 4:48 pm ¶
Mr X wrote:
No reason? Hmm – perhaps because Open Source Darwin isn’t a real data center grade server OS – whereas an open source OS they currently own, along with employing the vast majority of the worlds expertise in, is. Namely Solaris and Open Solaris.
Posted 09 Sep 2009 at 6:44 pm ¶
simon wrote:
@Mr X – Yes, the Enterprise side – including standalone applications are important. As are Web Start applications. I deliberately didn’t focus on those for the test and this write-up of the results. The story was complicated enough just with browser-based applets. Web Start apps and stand alone apps merit separate consideration.
Whether the integration you seek with Swing (i.e. JavaFX components embedded within a Swing app) is going to happen I really don’t know. If I had to guess, I’d say that it might not – JavaFX seems to be very much moving away from Swing and Java2D in its next release (Soma) with the introduction of the all-new rendering engine (Prism).
Posted 09 Sep 2009 at 7:13 pm ¶
Asam Bashir wrote:
Lot of those enterprise clients are part of the 50 million iPhone/iPod Touch platform, this market wants a good user interface experience too. Looking ahead, the larger form-factor touch platform will be a netbook killer, this will be an interesting platform for enterprise deployment that will change the way work is done.
SunofOracle should seek more radical ideas for how information is viewed and stored.
Posted 10 Sep 2009 at 5:20 am ¶
Mr X wrote:
So if we ignore the consumer space for a second ( which is very different ) and focus on the enterprise.
Enterprise markets can be roughly split into 3 ( obviously it’s slightly artificial – they overlap but it’s for illustrative purposes ).
1. The use computers as part of the infrastructure – like they use office chairs or heating systems.
For example:
- Nobody cares that the BlackBerry is a Java phone – even though you can program it, very few people do – email is just a core business tool.
2. Those that compete on *effective* use of IT as part of an overall efficiency/cost competitive advantage.
Typically, it’s all about ironing out roadblocks in the overall business process – replacing clerical jobs with a click of a button – electronic workflows etc.
3. Those that use IT as a true competitive advantage – and to do that they need software no-one else has, because they are doing stuff no-one else is.
New financial trading models, cutting edge R&D, new approaches that exploit the power of computers.
So at one extreme there are ‘throw away’ apps – cheap to build, ’single’ use – tend just to be custom views on existing data, and at the other – custom bespoke, highly complex apps which are the culmination of years of R&D.
How does JavaFX fit in?
The web is very successful in the ‘throw away, single use’ apps space.
Java is very good in the complex R&D space where rewrites to support new hardware or OS’s is a total waste of time – Java protects the investment very well.
JavaFX is pitched somewhere in the middle – not so easy as simple web, too much of a departure to be an easy add-on to existing code bases.
The problem for JavaFX is that middle ground in the enterprise is often about workflow – again something that the hyperlinked nature of the web is an excellent fit.
In the enterprise the place were you’d like the capability to do easy high tech interfaces ( as often these applications are complex and need sophisticated interface design to be useable ), data visualisation etc is in that R&D space – however that’s the space that values compatibility and performance…
Posted 10 Sep 2009 at 9:31 am ¶
simon wrote:
I agree with much of that. Having said that, the Enterprise does adopt new technology for new projects. For example, witness the rise of C# .NET in investment banking where once all there was was Java.
There’s no doubt that only working for new projects is a huge brake on adoption, though. Eighty percent of coding in the Enterprise is probably building on existing systems.
Bottom line is: if it’s technically feasible to make JavaFX panels embeddable in Swing apps, they should do it. If not, they just have to put their foot to the floor to build out the technology.
Posted 10 Sep 2009 at 10:29 am ¶
Asam Bashir wrote:
Another example would be medical enterprise and healthcare applications where need for good user interface is very high and you get good value for money by rapid change and development using the most current technologies….
Posted 11 Sep 2009 at 4:57 am ¶
José wrote:
There is apparently a third reason that affects how fast the demo will appear:
http://www.compare-review-information.com/earthquake-hits-javafx/
Posted 01 Oct 2009 at 1:07 pm ¶
Ken Warner wrote:
Here’s a clue –
Java is dead!
Posted 14 Jan 2010 at 6:31 pm ¶