The light-weight user interface toolkit for Java ME (LWUIT) has been released as open source under the GPLv2+classpath exception license. LWUIT is a library that helps content developers in creating rich and consistent Java ME applications. LWUIT supports visual components, theming, transitions, animation, and more. Sounds similar to JavaFX doesn't it? I asked Dave Hofert, group manager, Java platform marketing at Sun, to explain the differences.
According to Hofert, while both LWUIT and JavaFX enable creating a better and more compelling user interface for mobile and other devices, there are really two target audiences / handset profiles:
LWUIT is aimed at current Java MIDP and Swing developers who are looking to enhance the interfaces of new or existing Java ME applications on MIDP 2.0 phones. LWUIT is a library which offers pre-made graphical functions and features that developers can quickly and easily assemble into a compelling interface. LWUIT allows developers to worry less about the building blocks and instead focus on a consistent and richer interface across phones. Therefore LWUIT is something that existing Java developers can incorporate and make calls to out of their existing Java code.JavaFX Mobile is targeted at designers and scripters who are looking to create very rich, very immersive experiences across the screens of their life (phone, desktop, TV, etc.). The level of interactivity and animation and control over the user's screen is much higher than that enabled by LWUIT. JavaFX Mobile can also run on MSA-enabled devices which comprise the higher end of the mobile space - smart phones and high end feature phones.
The programming and UI design of the two systems is completely different as well.
JavaFX uses a declarative statically typed scripting language that allows people to build out interfaces by describing the functionality that they want to see, instead of building it from the ground up. This lets them think creatively and be creative. JavaFX includes scalable fonts, 2D graphics, rich animations, integrated audio and video, and you can build apps that will run across all the screens of your life.
In addition, with JavaFX, you can use design tools like Photoshop and Illustrator to build out graphical elements and even entire interfaces that you can directly build into and manipulate within JavaFX. This lets the designers and developers work much more closely and efficiently together.
So the bottom line is that if you're sprucing up an existing Java ME program, choose LWUIT. For new mobile and desktop apps, or if you're working in a multi-disciplinary team with artists and programmers consider JavaFX.
Of course neither will work (yet) on iPhones, Android phones, or standard Windows Mobile phones. It's unfortunate developers have to deal with all these different systems. If Apple open sourced the iPhone platform and allowed any handset manufacturer and any carrier to use it, they would be poised to completely take over the mid to high end mobile phone market within 12-18 months. But Apple doesn't work that way. Google does, but it's taking them so long to get Android out the door that they'll be playing catch-up for a while. It looks like the dream of "write once, run anywhere" will remain unfulfilled for the forseable future.