Download NetBeans!

20090331 Tuesday March 31, 2009

New Wizard Tutorial for the NetBeans Platform

Bartek Zdanowski (pictured left), one of the students who attended the recent NetBeans Platform Certified Training in Warsaw, and who won a copy of Rich Client Programming: Plugging into the NetBeans Platform because of all the good questions he asked, seemed to be interested in the NetBeans Wizard infrastructure. I mentioned it at the end of the training, while listing several other APIs that might also be interesting, but that had not been covered during the two days of training.

One of the great questions he asked was: "How do I localize the texts in a wizard?" And then I realized that, although various resources are available for creating wizards for NetBeans Platform applications, there isn't yet an official tutorial. So today I created it:

NetBeans Wizard Module Tutorial

Note: If anyone is aware of any other resources that should be linked into the above tutorial, PLEASE let me know. It would be great if the above document were to become a central reference point for everything relating to wizards created for NetBeans Platform applications.

It definitely covers most of the common use cases and questions relating to the Wizard API classes. One big area is missing, relating to validation of user input in the wizard, although the reference to Tom's sample at the end of the tutorial should be sufficient until I add that section.

In an e-mail to me yesterday, Bartek writes: "I plan to write a Jabber chat plugin that integrates with NetBeans. It should be a very nice addition for team work." Definitely! That would also qualify you as a "NetBeans Platform Certified Engineer"!

Mar 31 2009, 10:15:18 AM PDT Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/new_wizard_tutorial_for_the
Comments:

Regarding the validation: Besides the way proposed by Tom Wheeler, you can also use WizardDescriptor.ValidatingPanel interface, it defines "void validate() throws WizardValidationException" method. This method is called when the next/finish button is pressed. You can do the validation in it and throw that exception, which will display a red error message (with text specified as the exception's constructor parameter) in the bottom part of the panel. It does not, however, enable/disable next/finish buttons and the message is displayed until the next validation.

You can also put a message in that bottom part by using WizardDescriptor.putProperty method with one of the following properties:
- WizardDescriptor.PROP_ERROR_MESSAGE
- WizardDescriptor.PROP_WARNING_MESSAGE
- WizardDescriptor.PROP_INFO_MESSAGE
null value clears the displayed message

Btw. is the NetBeans javadocs web down now? I'm getting 404 for everything I try to look up there. I can open http://bits.netbeans.org/dev/javadoc/ but the rest is 404.

Posted by Honza Pozivil on March 31, 2009 at 11:23 AM PDT #

Awesome tutorial..

Posted by Varun Nischal on April 01, 2009 at 01:14 AM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed