Skip navigation

Monthly Archives: September 2009

The standard code used to display a dialog in NetBeans is:

DialogDescriptor dd = new DialogDescriptor(new UIPanel(), "UI Panel" ) ;
Dialog dlg = DialogDisplayer.getDefault().createDialog(dd);
dlg.setVisible(true);

This uses the DialogDescriptor and DialogDisplayer classes from the Dialogs API. You end up a dialog which looks like the image below.

However, what if you want to display some notification messages to the user? NotificationLineSupport to the rescue. Just create a notification line (code highlighted below) and add your message.

DialogDescriptor dd = new DialogDescriptor(new UIPanel(), "UI Panel" );
NotificationLineSupport supp = dd.createNotificationLineSupport();
Dialog dlg = DialogDisplayer.getDefault().createDialog(dd);
supp.setInformationMessage("Sample Information Message" );
dlg.setVisible(true);

The result is a dialog like the one shown below:

You can show informational messages, error messages and warning messages. However, displaying an error or a warning message does not disable the OK button. For that you will have to call the setValid() method.

One of the most innovative usage of GTalk to date has been as an ice breaker when me and my wife were sitting, poring into our notebooks, ignoring each other, after a petty quarrel. I wasn’t talking to her, and she wasn’t talking to me. So, there, I opened up GTalk, sent her a "hi" and we started chatting on GTalk, sitting almost next to each other. And what do you know! A smile appeared on her highness’ face in a matter of minutes.

I love technology 🙂

Ended up getting a brizzly invite and promptly got confused by the signup process. 🙂 Yes, I am a lame chap but look at the screen shot below. I thought that I needed to provide only my invitation code and pick a user name since the email and password field were grayed out.

But on clicking the signup button, I got an error (see below):

Yes! I know it’s not a valid e-mail address. But what kind of GUI takes focus away from a required field? Totally lame (and equally confusing).