Wednesday Jul 25, 2012

Simplified Usage of the NetBeans Platform

The latest NetBeans Platform application showcased at NetBeans Zone, Zirius, the Norwegian ERP System, is illustrative of how the bare minimum of the NetBeans Platform can be used, to the point where the NetBeans Platform doesn't show through at all:

On the one hand, this means that you're not leveraging the width and breadth of all that the NetBeans Platform provides. On the other hand, it takes time to migrate an application to the NetBeans Platform and the above is a logical first stage. Though you have modularity, an update mechanism, and a loosely coupled mechanism for communication across modules via the Lookup API, you keep everything else exactly as it was before: same UI, including same toolbar and menu bar.

That's possible because you can remove everything from the NetBeans Platform and start with a clean slate, in so far as the user interface is concerned:

Above, there's a single NetBeans TopComponent, with its tabs removed. The toolbar is removed and the menu bar is removed, with some dummy menu items added via a custom menu bar. Now you can treat the TopComponent like a JPanel and simply add all your UI components within it.

The application above looks like this: 

And the sources can be downloaded here:

The code in the repo above was written following the instructions described in the Zirius article. Using those sources, you can very easily create strictly defined user interfaces, i.e., without the flexible NetBeans window system, with a tree view on the left and a GUI pane on the right, like this, for example, i.e., an image viewer:

Similar applications on the NetBeans Platform, i.e., leveraging low level infrastructure, while all the rest are custom UI components within a single TopComponent, can be read about in these two articles:

What's also cool about the Zirius story is that Toni and I visited that company two years ago and, clearly, the NetBeans Platform message did not fall on deaf ears!


Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« July 2012 »