Help: Problem with the DialogDisplayer.getDefault().notify method

nagakishore sidde - Sun Microsystems - Bangalore India <[email protected]> Thu, 19 Aug 2010 14:59:05 +0530
Newsgroups gmane.comp.java.netbeans.general,gmane.comp.java.netbeans.modules.javawebstart.devel
Message-ID <[email protected]>
Hi all,

I am facing the following strange problem with the notify method of 
DialogDisplayer.

For the Oracle iPlanet Webserver, if more than one instance exists 
plug-in has to bring up a combo dialog to take the input (configuration 
name) from the user. For this task, we are using 
DialogDisplayer.getDefault().notify(d) method, where 'd' is a custom 
NotifyDescriptor. The problem is, notify method is immediately returning 
the default value(i.e -1), with out waiting for the user input i.e even 
though the dialog is up there, notify returns -1 value. This does not 
happen when i ran a standalone program to use the notify.

Why does notify method returns immediately with out waiting ?

In the process of finding out the exact problem i tried the following 
scenario's too

*Scenario one : *Calling the notify method in a separate thread using 
the SwingUtilities.invokeAndWait(). That piece of code is as follows..
 
SwingUtilities.invokeAndWait(new Runnable() {
            public void run() {
                DialogDisplayer.getDefault().notify(d);
            }
});

In this case invokeAndWait just hangs, with out even displaying the dialog.

*Scenario Two: *I have created a custom JDialog (with a combo box and 
two buttons)  by setting a modal type and setvisible to true. In this 
case, dialog (with out rendering any components in it) is displayed and 
it hung. But when the same piece of code was run as a standalone 
program, it worked perfectly fine.

Can somebody help me by throwing some light on why notify method 
(and/or) custom JDialog are/is  behaving differently, when ran on top of 
the netbeans.

Thanks and Regards,
Kishore.