This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
The DialogDisplayer.createDialog currently returns the AWT Dialog type. However, I have been told that it should always return JDialog type implicitily as long as the default dialog services are used. Because JDialog type has valuable features for controlling the dialog like disabling the close button, etc..., and AWT is not really used, I propose that all DialogDisplay.create functions return the JDialog as the base type instead of Dialog. The following code snippet is from the Netbeans sources itself and shows a common example of wanting to use the JDialog interface for disabling the windows close button. dialog = DialogDisplayer.getDefault().createDialog(dd); if (dialog instanceof JDialog) { ((JDialog)dialog).setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE); } A good example of this would be creating a cancellable dialog where the action to close the dialog is based on logic and state, not just user clicking the close or cancel button. In order to establish this functionality, one must listen for button and window messages. However, if you dont disable the default close operation, it won't work...Hence the reason for the code snippet above.
NotifyDisplayer has a similar problem because just closing the window you can ignore the message. I think this should be at least documented at the official javadoc.
DO_NOTHING_ON_CLOSE should be taken care of in #196200 Any other use cases for JDialog return value?