Just over a week ago, Sun announced a RAD tool for JavaFx built on the Matisse framework, I believe. I was very critical of JavaFx for its lack of tool for building UI and I think this is a step in the right direction. The tool was made available through the NetBeans Update Center on the 14/12/2009. OK, so I have installed the plugin and here are my views; not just on the tools but also on other stuff I think would benefit the JavaFx community:
When comparing something, it only makes sense when we use a benchmark; here my benchmark will be Adobe Flash Builder (formerly known as Flex Builder). Over the years, Adobe had made it easy for the designer to build impressive user interface with minimal coding. Sun, in the other hand, made it easier for developers to build application, yes I am aware of some nice UI in Java but they still do not compare to the eye candy of Flash/ Flex.
I am going to look at the tools; Flash Builder and JavaFx Composer plugin, from a developer perspective.
A key feature of RAD tools is the amount of components they make available to developers without having to write too many codes. I understand the plugin is at a “preview” stage, whatever that mean (alpha?), but there are alot of missing components; as an example, this release version was meant to be a “preview” of what to look forward to but I cannot drag a “combox” from the components palette into my form, no data grid, no chart, no menu bar, no date components and can’t even draw a rectangle which is possible but only through coding. I hope the JavaFx team add all the components available in JavaFx plugin to the Composer.
NetBeans JavaFx UI Composer
Adobe Flex/ Flash Builder
Round-trip code update
One thing I dislike with Java IDE’s (or most of them) is the inability to change the generated code without requiring you to write more code. The Adobe team actually made a good job in giving more freedom to the developer. In Flash Builder, you can design your UI through drag-n-drop but also customise it directly through the XML file (MXML). This feature was not available in NetBeans Matisse, I could be wrong, but and again Matisse was not really used in large project (no comments, thanks), at least not were I worked. Why all the fuss, you might ask? Try to create a simple interface and add a “rectangle” object to it which you will use as a toolbar and tell me how simple that was.
The coding style in JavaFx is very similar to Flex/ Flash ActionScript (so why the “V”oid instead of void, but that’s another issue) and very easy to learn. So far, I found it easier to actually code the canvas then using the Composer plugin. Another thing, when inspecting object properties; not all properties are available, for example: the gradient properties are not available, which will require you to write more lines of code.
UI Preview Panel
Again, a feature which Adobe Flex/ Flash builder excels at (I feel like I am starting to sound like an Adobe salesman) is the synchronize preview of codes. This is not a due to JavaFx Composer plugin but this seems as a bug as sometimes, you might have to restart the IDE in order for the UI Preview panel to start working again. Hopefully the introduction of the RAD (or not so much RAD) tool, will fix this issue.
You might feel that I was on a JavaFx bashing quest but this is not the case. JavaFx might not have a large components set (well what about all the SWING components available which you can use? You might not be able to “skin” them to your application look and feel but they still availabe to you) but I still think it has a good future. If you take a look at the screenshot below which was built with Adobe Flex, it took me less than five (5) minutes to build. Now time to synchronize your watches and tell me how fast it will take you to build the same interface using JavaFx Composer plugin. It will probably take me less than five (5) minutes if I was designing it with Matisse. My point is; a RAD tool is supposed to promote productivity and YES!!! I have realized this is a “PREVIEW” release but can you actually use it? I know I will still be coding JavaFx for the foreseable future and I would love it to succeed. If you are going to call a tool “a RAD tool for building Form-based JavaFx UI” then I suggest that you provide most of the form components.
Should JavaFx UI RAD tools be based on XML like Android and Adobe Flash Builder?
5 components I like to have on JavaFx
- Menu and tool bar (come on guys, this was there in previous release)
- Grids (even just a simple table will do. For now I use JTable)
- Date picker, Rich Text and Navigator components
- HTML panel (something that display HTML and can also be used as iFrames)
- Panels similar to JInternalFrame (this will be useful in portlet-like applications)
I know it’s not really 5 things but they will make a difference. Thanks for reading and tell me what you think about JavaFx and its UI Composer.