What's Wrong With JavaFX and What Needs Fixing?
What's Wrong With JavaFX and What Needs Fixing?
Join the DZone community and get the full member experience.Join For Free
Take 60 minutes to understand the Power of the Actor Model with "Designing Reactive Systems: The Role Of Actors In Distributed Architecture". Brought to you in partnership with Lightbend.
As a point of reference, there are tons of Swing-based apps, some that qualify as being excellent rich multi-media apps. I've been looking for some nice examples and found some that really impressed me. A few examples that I found on the NetBeans Platform site (the descriptions are included as well):
|-||BlueMarine - is an open-source application for digital photo workflow. The blueMarine project provides you with an all-in-one tool for managing your photos, from the shoot up to archiving and beyond.|
|-||MassTk - is an engineering analysis application by Boeing. It incorporates the functionality from several legacy mass properties analysis applications that were originally written in Java, Fortran, C, and even Perl. It provides a rich GUI with custom editors for all business objects including 2D & 3D visualization. In addition to this application there is the Boeing Shared Platform is a logical outgrowth of building MassTk on top of the NetBeans Platform: BSP is a feature-rich platform created by factoring out the modules from MassTk that are not specific to mass properties analysis, but are useful to engineering analysis applications in general.|
|-||ThinkingRock is a free, platform-independent Java application for collecting and processing your thoughts. This simple and easy-to-use tool follows the Getting Things Done (GTD) methodology|
|-||Domito Manager, by MCD Electronics in Poland, configures a system that controls lighting, heating, and opening/closing of gates in houses. In the building sector, a system of this kind is known as an "intelligent home".|
|-||The Sepix Sales System is a customer relationship management system for sales managers on the road. At this stage, the application is running on the NetBeans Platform with a fully functional module for mapping and routing. The application offers a map display, works as a route planner, and is capable of displaying data from a database as geolocations. You can display any type of graphical layer over the map, with sales territories or any kind of POIs, such as speed limit zones.|
|-||Nokia offers a complete solution for managing mobile networks and end-user services, called Nokia NetAct™, ranging from control-room software for 24/7/365 monitoring of the network to software for graphical optimization.|
|-||Puzzle is a Java Geographic Information Systems (GIS) development platform. The main goal of Puzzle GIS is to create a free, production ready and competitive tool as a valid alternative to commercial software.|
|-||Agile Client is a NetBeans Platform application developed by Northrop Grumman in partnership with the Defense Information System Agency (DISA). It brings the war fighter a 3-D common operational picture (COP) workstation designed for greater efficiency and mission effectiveness.|
All of these applications seem to have three things in common:
- They are built using the NetBeans Platform.
- They are data-intensive applications that in most cases are of a mission critical nature.
- People use them to do real work and an intense number of data aspects need to to be visible (textually or graphically or both).
The NetBeans Platform constitutes a framework for getting difficult things done relatively quickly - not simply from the standpoint that it provides a wealth of resources and allows the architecting of large modular software but it also allows integration with other frameworks.
Slightly different Swing-based demos such as Aerith (code is here) provide excellent demonstrations of what one can do with Swing graphically. They leverage not only Swing but also - Java2D, OpenGL, Timing Framework (for animations), SwingX, Matisse, Google Maps, Flickr, Yahoo! and more. This is an example of the beauty of a nice open non-proprietary set of frameworks all playing together with open interfaces to web services. Note among these frameworks are a number of residents at SwingLabs.
So let's add Aerith to our list- since the code is out there and it offers an example along with some very flashy functionality. A few more:
|-||Aerith is a Swing Mashup, or smashup, combining three webservices: Google Maps, Flickr, and Yahoo's geocoding webservice to let users create, view, and share slideshows of their road trip photos. It was presented as a demo at the 2006 JavaOne conference by Richard Bair, Romain Guy, and Joshua Marinacci.|
|-||Vuze (formerly Azureus) which is a is a BitTorrent client written in Java - I would be remiss in not including Vuze in the list of excellent Java-based applications - even thought it doesn't use Swing but rather SWT. It is an excellent example of a Java GUI.|
|-||In the Games area - Runescape and Tribal Trouble are two examples of how Java can provide a rich game experience|
I will continue to create "the list" with the idea that (a) it might give a developer a perspective on what people are doing (b) how they are constructing their apps. I also encourage developers to look at the extreme Swing series from past JavaOne conferences.
Meanwhile, I do see the beginnings of JavaFX apps beginning to emerge such as musicpin from GUI thought-leader, Canoo, and Indaba's Collaborative Digital Audio Workstation. A JavaFX development tool, JavaFX Builder, is also available and is very interesting. However, surprisingly, that seems to be it except for the recently concluded JavaFX contest. If you know of others I would love to know about them.
It is entirely possible that the arrival of JavaFX has confused some developers and this confusion may have even caused problems for Java on the client-side. Why has this happened? I have to remind myself where JavaFX is aimed at going - Sun has announced JavaFX is aimed at the - [a] desktop [b] mobile and [c] interactive devices including television. Perhaps the tag line about JavaFX being for "all the screens of our life" has served to confuse things even more. For the same reason that an aerospace company would choose the Swing/NetBeans Platform over Flex or Flash - I also would make the same choice and probably for the same reasons. To these same developers and companies, they will look at JavaFX as being in the same RIA boat (and it is) and they look at it as containing less architectural flexability than a Swing RCP (modules/plugins, resources, RCP structure, etc). The vagueness and marketing tag lines have served to confuse a fair amount of people and I am not the only one that thinks that.
If you have followed my blog, you will know I have been very supportive of JavaFX (you can see from my past JavaFX blogs ) - JavaFX has its place - but that space is a lot smaller than the JavaFX marketing suggests. Over time issues have emerged that really need fixing and after some discussions with other Swing developers at JavaOne and post-JavaOne it looks like I'm not the only one with these feelings. What's wrong with the JavaFX?
|-||Lack of a module system such as those found in Eclipse and NetBeans. The biggest thing people gain from the NetBeans and Eclipse Platforms is being able to break their application into parts, called modules. As a result of not having a module system JavaFX apps are relegated to remain small, which in some cases such as small rich internet applications, is fine. Wouldn't it be nice if JavaFX could integrate into Swing to be leveraged by existing module systems such as the NetBeans and Eclipse Platforms?|
|-||Lack of Two-Way Integration with Swing. This is huge. The one way integration that exists is unacceptable and apparently artificial. Integration of JavaFX into existing Swing application's isn't supported and that's where it could turn out to be most useful. This is a huge oversight and hurts the use of the fledgling language's adoption. More important - it's easier to build your larger apps using an RCP - which would allow two way integration of Swing/JavaFX and leverage the modular architecture of the RCP.
|-||Lack of Controls. There simply are not enough controls - the description I read in a blog the other day mentions the absence of the Tree and Table controls. Ouch! Keep in mind that Swing has a multitude of controls. Controls like SwingX controls offer a number of additional controls which even offer themselves up to be used as components in NetBeans GUI Builder. The hype that is surrounding the JavaFX 1.2 controls available is also disconcerting - "JavaFX 1.2 has real UI controls, designed for the 21st century". If you look at the controls on the page - you shouldn't feel dumb - the majority look like Swing controls and the statement misses the fact that there are a huge number of Swing and Java-based controls available- including smart charts, smart report components and many more useful "21st" century controls.|
|-||Visual Development Tools. One gaping and large hole is lack of visual development tools. The exception to JavaFX tools is NetBeans - at least with NetBeans you can write JavaFX code. However in this space you need a visual graphical builder and there is no graphical development builder, yet.|
|-||Proprietary Framework. If the intention is to make JavaFX a viable alternative to Swing then JavaFX needs to be totally (not partially) open sourced just like Swing, Java, NetBeans Platform, Eclipse, etc. By not open-sourcing JavaFX it retains no advantage over other competing RIA platforms and we should not be confused about the difference between OpenJDK (which has been open-sourced) and JavaFX. It also becomes less likely that JavaFX becomes an open source alternative to Swing and Swing-based frameworks if it is not completely open-sourced.|
|-||Lack of Transparancy into JavaFX Roadmap. In keeping with the non-open source nature of JavaFX - there is almost no visibility into what is going on - if I look at NetBeans or Eclipse or OpenJDK - I know where those projects are going. For example, NetBeans has visibility into what they are building for the next release on a page that describes the features being worked on. I have no clue what new controls will emerge in the next release of JavaFX - let alone other developments. What constitutes the next release?|
JavaFX does not currently satisfy all the screens of my life despite the marketing tagline. Some will erroneously view this as an attack on JavaFX - it is not. This is simply part of the community discussion that has already started and is aimed to make JavaFX better - the starting place needs to be integrating JavaFX and Swing in a meaningful two-way street (the answer to "it's hard" - is "most good things are"), provide better transparency into its roadmap, and making it open source. At JavaOne I was asked for my opinion on using JavaFX in real apps - I answered (after going through some of the issues above) that it depends on the type of app and it depends on your comfort zone with the above issues.
Opinions expressed by DZone contributors are their own.