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

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

I am working on the webserver netbeans plugin.

In the plugin code, there is a scenario in which user input has to be 
taken using combo dialog box. For this task, i am using 
DialogDisplayer.getDefault().notify(d) method, where 'd' is a custom 
NotifyDescriptor. The problem is that, 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 is 
happening only when notify method is used as a part of plugin code on 
top of netbeans. Standalone program works perfectly fine.

Why does the notify method returns immediately with out waiting when 
used on top of netbeans ?

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 when ran on top of netbeans. But when the same piece of code was 
run as a standalone program, it worked perfectly fine.

Can somebody please 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.