Thursday Dec 31, 2009

Simplification of Node Creation

I received a bunch of comments from Jesse Glick about How to Create a Web Service Client with Groovy and NetBeans Platform 6.8. I'll be changing that article a lot, as a result.

Here's one of them:

     public void resultChanged(LookupEvent le) {
-        quotes = new ArrayList<ShakesWsClient>();
-        Collection<? extends ShakesWsClient> coll = result.allInstances();
-        for (ShakesWsClient client : coll) {
-            //Add all the ShakesWsClient in the context to the ArrayList:
-            quotes.add(client);
-            //Call "createKeys":
-            refresh(true);
-        }
+        quotes = new ArrayList<ShakesWsClient>(result.allInstances());
+        //Call "createKeys":
+        refresh(true);

I.e., no need to iterate through the result instances, just pass them in as the ArrayList parameter.

Wednesday Dec 30, 2009

Music Creator on the NetBeans Platform

Yet another NetBeans Platform application is... the music creator, which is a MIDI synthesizer with keyboard and danceboard integration. "The requirement for this project was to use a dancing board as an input device for our program. Instead of creating a program where people can dance on, we decided to do the opposite. By pressing the buttons on the dance board or keyboard you can create sounds. You are able to record those sounds. After making a couple of recordings you can arrange them on the recording tracks and play them as if they were one song."

Here's what it looks like when I run it from sources in NetBeans IDE:

And, of course, among many other things (such as modularity and a window system), the Matisse GUI Builder must have been pretty useful when constructing the forms in this application:

The application was created by Benjamin Coggin, Youngho Cha & Ingmar Hendriks at Edith Cowan University in Perth, Australia. Ingmar is one of the students that Toni and I trained at the Hogeschool in Amsterdam, the Netherlands. Plus, this is his second application on the NetBeans Platform that you can read about in his software portfolio.

And here you see it in action (plus danceboard action!) in a YouTube movie:

The beta seems to have been released in the last day or so. Congratulations guys!

Wildland Fire Management on the NetBeans Platform hosts a NetBeans Platform based implementation of the Campbell Prediction System (CPS), which helps manage and predict the behavior of wildland fire. CPS is described as being used to adjust tactics and strategies to ensure the safety of firefighters and the effective use of resources.

I've seen this CPS implementation on Kenai before, but a lot of development seems to have been taking place in the past few weeks and so I downloaded it to have a look. A lot of work is going into the project, with project lead Bruce Schubert's @Emxsys twitter link being an interesting one to follow.

Here's what the NetBeans Platform based application looks like currently:

This is a NetBeans Platform application with a 3D terrain viewer using NASA WorldWind, JOGL, VisAD and Weka libraries.

Go here for all the details:

Tuesday Dec 29, 2009

Essential NetBeans Platform Refcard in the NetBeans Platform Fundamentals List

To the list of "NetBeans Platform Fundamentals" on the NetBeans Platform Learning Trail has been added... the Essential NetBeans Platform Refcard:

Clicking the image on the page takes you to the download page of the Essential NetBeans Platform Refcard, which is here:

Tuesday Dec 22, 2009 article on the NetBeans Platform

Yesterday another great article by Kevin Farnham, editor at This time he wrote about Saab Grintek Systems on the NetBeans Platform (interview here).

Especially the conclusions in Kevin's article were pretty cool:

Monday Dec 21, 2009

NetBeans Platform 6.9 Buzz

The buzz is buzzing:

The above can be read in full here.

Sunday Dec 20, 2009

Big NetBeans Platform Announcement for NetBeans Platform 6.9

In case you missed it, the latest NetBeans Platform Podcast includes a segment with big announcements relating to the NetBeans Platform. Don't have the time to listen to the whole podcast? If you have 7:20 minutes, you can listen to the NetBeans Platform specific section here (with about 2:30 minutes preamble about NetBeans IDE):

And, in case you're left wondering what all that means in real life, take a look here at plans for NetBeans Platform 6.9, geared specifically at enterprise RCP developers, including OSGi support.

In related news. Download the brand new NetBeans Platform Refcard today!

Griffon and NetBeans IDE 6.8

Go here and download the latest NetBeans plugin for Griffon, which you can install into NetBeans IDE 6.8:

Make sure that the suffix of the ZIP that you get when you click the Download button is "". Then unzip and you will have two NBM files which, when installed into a distribution of NetBeans IDE 6.8 that includes Groovy support, will let you create Griffon applications in NetBeans IDE, together with a whole bunch of tooling, such as this dialog for accessing and installing Griffon plugins:

If you encounter any issues or if you have ideas for enhancements, the project page is here on Kenai:

Tuesday Dec 15, 2009

Project-Based Customer Application (Part 2)

Some progress on the project-based customer application. As shown yesterday, you can select one of two types of customers (e.g., "internal" or "external", for example):

But now, you can also set an icon for the customer: that the project node now, instead of a generic project-level icon, has a customer-specific icon, i.e., the image of the particular customer:

I am not necessarily recommending the approach I took. There are probably definitely better ways of doing this.

Anyway, this is what I did. In the "instantiate()" method within the template's iterator, I create folders and an attribute in the System FileSystem, based on the project name and icon set in the wizard:

//Project name set in the project template wizard:
String projName = this.wiz.getProperty("name").toString();
//Project icon set in the project template wizard:
String icon = this.wiz.getProperty("icon").toString();

//Create a "Customers" folder in the SystemFileSystem:
FileObject customersFolder = FileUtil.getConfigFile("Customers");
if (customersFolder == null) {
//Within the "Customers" folder, create a new folder,
//using the name of the project:
FileObject customerFolder = FileUtil.getConfigFile("Customers").createFolder(projName);

//Set the location of the icon as an attribute of the folder:
customerFolder.setAttribute("icon", icon);

Then, in the "ProjectInformation.getIcon", I copy the icon into the System FileSystem, then I find it there, and return it. The last piece of this part of the code is as follows (a lot more comes before it, for the copying of the file from the user's location on disk, into the System FileSystem, via FileUtils.copyFile):

URL imageURL = new URL("nbfs:/SystemFileSystem/" + copiedFo.getPath());
return new ImageIcon(imageURL);

And now each customer in the application has a user-defined customer-specific icon, rather than one hard-coded for the project type.

Monday Dec 14, 2009

Project-Based Customer Application

A very interesting idea came up in the comments to my recent article How to Create a Swing CRUD Application on NetBeans Platform 6.8. Someone, essentially, suggested the idea of creating a tutorial that lets the user create new projects based on customers, with this type of structure:

- Geertjan

So, today, on my disk I created a folder structure like that:

And now I'm able to open those structures into a new NetBeans Platform application:

Just about the best thing about the screenshot above is that each node (i.e., "Balance", "Orders", "Reports") can be provided externally, by a plugin:

So, if your folder/file structure for your customers changes... you can simply exclude the plugin for a folder that is removed or include a new one, custom made for a new folder in your folder/file structure. Now that's really powerful. Here, for example, you see that I've disabled the plugin that provides support for the Reports folder and, as a result, my projects do not have a Reports folder anymore:

Project templates will be added for creating these customer projects (since, right now, I'm simply opening the projects from the Favorites window): well as some simple editors for visualizing the XML in the files you see above, probably using the XML MultiView API.

Then I'll create a new tutorial entitled "How to Create a Project-Based Customer Application on NetBeans Platform 6.8".

And here's the related source code:

In other news. Wondering if Groovy is for you? As a NetBeans Platform developer, the answer can only be "Yes, definitely!" and you can even continue coding in Java. I.e., for a hybrid Java/Groovy application (where Groovy is simply an implementation detail of Java), see How to Create a Web Service Client with Groovy and NetBeans Platform 6.8.

Friday Dec 11, 2009

Groovy Advice Needed for Shakespeare Web Service Client

What is the most efficient way to do this? Right now, I've pared my Groovy code down to this:

class ShakesWsClient {

    String play, speaker, words

    void findQuote(searchString){
        def proxy = new WSClient("", ShakesWsClient.class.classLoader)
        def speech = new XmlParser().parseText(proxy.GetSpeech(searchString))
        play = speech.PLAY.text()
        speaker = speech.SPEAKER.text()
        words = speech.text()

That allows me to get at the play, speaker, and text from my Java code as follows:

public class Demo {

    public static void main(String[] args) {
        ShakesWsClient client = new ShakesWsClient();
        client.findQuote("fair is foul");


Ant output:

12 Dec 2009 4:04:10 PM org.apache.cxf.endpoint.dynamic.DynamicClientFactory outputDebug
INFO: Created classes: com.xmlme.webservices.GetSpeech, com.xmlme.webservices.GetSpeechResponse, com.xmlme.webservices.ObjectFactory
12 Dec 2009 4:04:11 PM getBindingOperationInfo
WARNING:  Using SOAP version: 1.1
Fair is foul, and foul is fair: Hover through the fog and filthy air.
BUILD SUCCESSFUL (total time: 6 seconds)

Anyone out there with suggestions for how to improve my Groovy code (even further)?

By the way, I believe that Groovy's web service support is the best thing about Groovy, especially if you mainly want to continue working in Java.

Searching for Shakespeare on Groovy and the NetBeans Platform

Since writing How to Create a Swing CRUD Application on NetBeans Platform 6.8, I've come to realize that more end-to-end scenarios like that are needed. So here's the next one I'm working on—a Shakespeare quote client. The web service is accessed via Groovy, which is also used to parse the result. All that (two Groovy JARs, plus a JAR containing the Groovy class that defines the interaction with the web service) is in one module. In a second module, the UI is provided, i.e., the window where the search string is entered and sent to the "Groovy" code (because, at compilation, your Groovy is Java):

The result is displayed in a BeanTreeView, using BeanNodes, synchronized with the Properties window. Double-click a node and you bring up a dialog containing the retrieved text, as shown above. There's also a progress bar to avoid the situation where the UI is blocked during the processing of the web service.

private void findButtonActionPerformed(java.awt.event.ActionEvent evt) {                                         
   Thread t = new Thread(new WSRunnable());

private class WSRunnable implements Runnable {
    public void run() {
        ProgressHandle p = ProgressHandleFactory.createHandle(
                "Fetching the Shakespeare quote for " +
                "'" +searchField.getText() + "'");
        QuoteBean bean = new QuoteBean();
        ShakesWsClient client = new ShakesWsClient();

Above, in bold, is all the code needed to integrate with the progress bar!

And here's the same scenario as above, using an AbstractNode instead of a BeanNode, which gives you more freedom, but also more responsibility:

A full tutorial to describe all of the above will be on NetBeans Zone soon.

In other news. All the code for the above, plus a bit more, is available here on Кеnai:

Thursday Dec 10, 2009

Winner of NetBeans IDE 6.8 Screenshot Competition

With the release of NetBeans IDE 6.8 (today) (hurray!) the time has come to reveal the winner of the NetBeans IDE 6.8 screenshot competition. OK, no one knew about this competition because I just invented it myself, plus I am the winner as well, so go figure. Here's the screenshot:

That's Lombok... i.e., forget about typing (and updating!) getters, setters, hashCode, toString, because Lombok does that for you. All you need to do is add an annotation to the class, type the names of your variables, and then, under the hood, everything is generated into the bytecode!

Thanks to Jan Lahoda for the NetBeans integration.

Here's the interview (from where I took the screenshot above, which is by me):

...and here's the screencast by Alexis that shows you a complete Java EE 6 demo with Lombok:

Whoever ends up 'owning' Java, the first thing they should try and accomplish is integrate Lombok into the JDK.

Tuesday Dec 08, 2009

CRUD on the NetBeans Platform, CRUD on Kenai

Integrating a database into a Swing application is a very standard thing to want to do. How (and does?) the NetBeans Platform help?

On NetBeans Zone you can read an article based on an updated NetBeans Platform tutorial, which takes you through each and every little step involved in creating a CRUD application that looks exactly like this:

Or, if you prefer, like this:

Complete source code is also provided (created and uploaded to Kenai today):

And here's the whole article:

How to Create a Swing CRUD Application on NetBeans Platform 6.8

Comments more than welcome.

Thursday Dec 03, 2009

Get Paid to Port An MS-Access Application to the NetBeans Platform!

Here I recently drew attention to a job opening for porting a Swing application to the NetBeans Platform. Now, here is another job opening relating to the NetBeans Platform, again one where you need to react quickly:

We need someone to rewrite one MS Access application into Netbeans Rich Client Platform.

The app is targeted to presales with some Customer Relationship Management functionalities. We will provide the basic database structure and snapshots of the current application.

If you have 5+ years of Java experience and proven experience creating Netbeans RCP apps, we will review your bid.

Project is considered completed successfully only after it passes our functional tests and quality assurance. Coder understands that we cannot use at all a product that is only partially complete or partially ported. And so if project is not approved in full by us, then the coder will not ask for any partial fee for the project. By accepting the project the coder agrees to all terms in this doc and in the project proposal.

Go here for all the relevant details, deadline for your bid is 11 December 2009:

And drop me an e-mail if you get the job! Would be great to hear about your experiences and share those with others on similar projects!

Sun VP Blog Entry on the NetBeans Platform

Just when I was thinking what I should blog about today, I was told about this blog entry published today by Jim Parkinson, Sun VP: "With the release of NetBeans 6.8, you'll see a more public effort to support the Platform as a product. This is being driven by overwhelming support, by our customers and the open-source user community. Thank you to the community members who tirelessly use, support and improve the NetBeans Platform. You can see the NetBeans Platform in action at"

And that's only part of it, read more in the blog entry itself, published today, where the above quotation comes from. As someone who has been working over several years in providing documentation and training around the NetBeans Platform, and in following developments in relation to it, I can say without any hesitation that these words would never have been spoken by a Sun VP without there being genuine belief in the product being referred to. Many very interesting developments will visibly take place in the coming period, specifically for developers creating their own enterprise applications on top of the NetBeans Platform. Hurray!

In related news. Take a look at this page for upcoming plans for the NetBeans Platform:

Tuesday Dec 01, 2009

Visual Acorn: Bioinformatics on the NetBeans Platform

Visual Acorn is a bioinformatics project on the NetBeans Platform. It is part of a larger project, called ACORN. ACORN, managed by Jacek Sroka (University of Warsaw) and Andrzej Kierzek (Surrey University), is a grid-based web server for constraint-based modeling and visualization of genome scale metabolic reaction networks.

The developer behind Visual Acorn is Mateusz Markowski, a student from one of the courses Karol Harezlak and I did in Poland, for the Warsaw JUG on 22-23 November 2008. Visual Acorn enforces authentication, after which you can draw visualizations (pathway maps) of genome scale metabolic reaction network models. You can save these visualizations in a MySQL database on a sysbio3 server at Surrey University. Furthermore, visualizations can be managed (save/edit/delete) and you can display visualization results of Flux Balance Analysis, which is a calculation of the maximal theoretical value of the objective function under media conditions specified by user-linear programming.

Below are some screenshots Mateusz sent me:

So, in addition to the rat brain analysis application, and the list of applications discussed here by Toni, this is yet another bioinformatics application on the NetBeans Platform.


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.


« December 2009 »