Most Read Latest News Blog Resources

JavaFX praised for interface, but layouts could use work




January 30, 2009 — 
When Jim Weaver was looking to teach his grandson how to be a programmer, he wanted to create a little interactive world through which the youngster would be able to navigate.

In creating a user interface that would allow his grandson to drag and drop animated icons and objects onto a layout featuring Thomas the Tank Engine or other cartoon characters, Weaver took a liking to Sun Microsystems’ new JavaFX platform because it solved some longtime Java problems.

“That was a first little program for him that would teach him how to program,” said Weaver, who serves as senior vice president of technology for Marion, Ind.-based digital media provider Veriana Networks. “I wanted to generate JavaFX code from the interface. After I got into JavaFX, I found it solved a lot of the problems I had faced over the years in being able to do rich client Java. Attempts that were made to do rich client Java since Java was created in 1995 were pretty much thwarted by deployment problems.”

Jim Weaver used JavaFX to help visual tool provider Malden Labs create the 6th space user interface.
Weaver never actually created that program for his grandson using JavaFX (he settled on MIT’s kid-friendly Scratch programming language), but his enthusiasm for the platform hasn’t waned.

Sun’s eye was on solving many issues around rich Internet applications (RIAs) when it released version 1.0 of JavaFX in December, 2008. The platform targets both Windows and Mac OS X, and it can be used to construct both Web and desktop applications. Java video codecs enable video playback, and there are development plug-ins for Eclipse and NetBeans.

Sun executives believe that JavaFX is in a position to replace PHP as a presentation layer and that the platform has a more replicable development model than other RIA platforms like AJAX. But with the other major RIA platforms, such as Adobe Flex, AJAX and Microsoft Silverlight having a head start, there may be spots where Sun can be polished in coming releases.

JavaFX’s biggest benefit is its ability to call millions of Java classes with its rich client Java, according to Weaver, who also writes a JavaFX blog. JavaFX compiles class files and runs in Java virtual machines.

Another big advantage is the ability to declaratively script a user interface. Weaver said JavaFX’s JSON-like syntax makes it very easy to do, and a developer can declare a user-interface scene graph very intuitively. This makes it easy for people that aren’t necessarily experts with Java to script and create user interfaces.

“It’s a pretty rich library now in 1.0 as far as the ability to put together user interfaces, and it has a rich API for doing graphics,” Weaver said. “Its [strengths are] being able to animate, do effects, and parse XML and JSON for being able to do mashups or communicate with the back end.”

JavaFX’s ability to improve Java deployment and make Java leaner was something that drew Jeremy Chone, CTO of Nexaweb, to the platform. Nexaweb provides an RIA framework based on XML that enables developers to create applications similar to Swing, which is Sun’s widget toolkit for Java. Chone said that JavaFX has a lean and simple client, and he praised the platform’s user interface.

“When you work with UIs, you want to have a language that is a little bit more sugarcoated, and you want to have an easy way to do certain tasks, like creating new objects and sets,” Chone said. “That is one of the good things that JavaFX does.”

Growing up to do
Naturally, because JavaFX was released in late 2008, it doesn’t have the maturity level of some of its RIA counterparts. Adobe's Flex was first released in March 2004 and is currently in version 3.2. AJAX started to take off in 2005. Microsoft’s Silverlight hit version 1.0 in April 2007 and is now in its second version.

As JavaFX moves toward its next phase, there are some changes that developers would like to see. Weaver said that JavaFX could use a richer selection of layouts. He noted that the platform currently has a couple of layout managers, among them HBox and VBox, which are graphical nodes that offer a simple horizontal and vertical layout, respectively. However, this is an area that Weaver thinks can be improved. “I’d like to see a richer set of layouts, whether it’s from Sun or a third party,” he said.

Another shortcoming in the first release of JavaFX is that most of the user interface controls are from Swing. Weaver said he’d like to see Sun use a style-sheet model in the vein of CSS (Cascading Style Sheets). This may happen because the API allows for third parties to create models like that, he predicted.

Like Weaver, Chone mentioned JavaFX’s JSON-like syntax, but he said he had mixed feelings about it.

“I am a little biased towards XML, but the fact that Sun decided to go with a JSON-like syntax is better than designing in code,” Chone said. “At the same time, it’s a little bit harder to build tools around. The scripting can sometimes be a little tricky because, as a Java developer, the scripting language is not true Java. A lot of Java developers I’ve talked to are disappointed that Sun didn’t hang on to the core language.”

To help close the maturity gap, there are some open-source projects working on patching up some of the deficiencies in JavaFX. One of them is JFXtras, which creates add-ons and utilities for the JavaFX script language. Some add-ons include the JFXtras Grid, which has an advanced layout container for JavaFX nodes and wrapped Swing components, as well as a unit testing facility for writing JavaFX tests. In the future, JFXtras plans to release features like serialization to and from XML, graphing and charting for business applications, and a variety of JavaFX-based components like sliders and tables.

Weaver, who is involved in the JFXtras project, said that the JavaFX community has a good relationship with the project when it comes to creating missing components. “On the subject of layouts, for instance, there is nothing in JavaFX now that is analogous to JFXtras Grid,” he said. “It is good that Sun will both get input from the community and create their own layouts and components.”


Related Search Term(s): JavaFXRIAs


Share this link: http://www.sdtimes.com/link/33226
 

Add comment


Name*
Email*  
Country     


  • Comment
  • Preview
Loading



 
 
 
 
News on Monday
more>>
SharePoint Tech Report
more>>


   

 
 
Download Current Issue
ISSUE 3/15/2010 PDF

Need Back Issues?
DOWNLOAD HERE

Receive the print Edition?


 
blogs tab
Google Code turns 5
Google Code Turns 5, and adds a Paxos Algorithm to make the system more stable and reliable.
03/17/2010 11:16 AM EST

Test your Visual Studio 2010 know-how
Microsoft is offering free beta certification exams for Visual Studio 2010.
03/17/2010 11:08 AM EST

Microsoft lifts the hood on IE9
Microsoft is previewing IE9.
03/16/2010 01:10 PM EST

 

Events calendar tab
3/22/2010 to 3/25/2010
Santa Clara, Calif.
The Eclipse Foundation

4/12/2010 to 4/14/2010
Las Vegas
Penton Media

4/12/2010 to 4/15/2010
Santa Clara, Calif.
O'Reilly Media

4/19/2010
New York City
Flagg Management

4/25/2010 to 4/28/2010
Overland Park, Kans.
IIUG