JDK-6179675 : REGRESSION: Confirm Dialog hangs application if parent frame disabled.
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: linux
  • CPU: x86
  • Submitted: 2004-10-15
  • Updated: 2011-01-19
  • Resolved: 2004-11-23
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
5.0Resolved
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)


ADDITIONAL OS VERSION INFORMATION :
Linux zeus.uk.irisfinancial.com 2.4.22-1.2115.nptlsmp #1 SMP Wed Oct 29 15:30:09 EST 2003 i686 i686 i386 GNU/Linux

A DESCRIPTION OF THE PROBLEM :

If the JFrame used in a JOptionPane.showConfirmDialog() call is disabled, the call never returns.


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Write a swing application which has a menu item that disables the main JFrame and calls JOptionPane.showConfirmDialog() using the main JFrame.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Method returns with result indicating which option was selected.
ACTUAL -
Application hangs.  Here is a thread dump of the AWT-EventQueue:

 "AWT-EventQueue-0" prio=1 tid=0x082f9fd0 nid=0x2667 in Object.wait() [0x46287000..0x46288500]
        at java.lang.Object.wait(Native Method)
        - waiting on <0x65c61c78> (a java.awt.EventQueue)
        at java.lang.Object.wait(Object.java:474)
        at java.awt.EventQueue.getNextEvent(EventQueue.java:345)
        - locked <0x65c61c78> (a java.awt.EventQueue)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:189)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:153)
        at java.awt.Dialog$1.run(Dialog.java:515)
        at java.awt.Dialog.show(Dialog.java:536)
        at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:843)
        at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:771)
        at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:734)
        at javax.swing.JOptionPane.showConfirmDialog(JOptionPane.java:696)
        at swing.HelloWorld$1.actionPerformed(HelloWorld.java:62)
        at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
        at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
        at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
        at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
        at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
        at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
        at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
        at java.awt.Component.processMouseEvent(Component.java:5488)
        at javax.swing.JComponent.processMouseEvent(JComponent.java:3093)
        at java.awt.Component.processEvent(Component.java:5253)
        at java.awt.Container.processEvent(Container.java:1966)
        at java.awt.Component.dispatchEventImpl(Component.java:3955)
        at java.awt.Container.dispatchEventImpl(Container.java:2024)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
        at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
        at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
        at java.awt.Container.dispatchEventImpl(Container.java:2010)
        at java.awt.Window.dispatchEventImpl(Window.java:1766)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:234)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)



REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
jframe.setEnabled(false);
int reply = JOptionPane.showConfirmDialog(jframe, "Do you want to quit?", "Quit",
                                                                                  JOptionPane.YES_NO_CANCEL_OPTION);

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Do not disable the JFrame.

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.
###@###.### 10/15/04 03:53 GMT

Comments
EVALUATION Sounds like this might be an AWT bug, but we (Swing) should have a quick look first. ###@###.### 10/18/04 14:32 GMT Definately sounds like a bug. The developer probably made the frame disabled since the option pane used to not be a modal dialog. This is no longer necessary. Updating the code in the app will probably fix this, but having that code should not cause this. ###@###.### 2004-11-18 23:41:08 GMT I messed up the initial eval. This is not the internal frame methods of the JOptionPane class, these are the dialog versions. These did not change for the modality work done. I'll try to reproduce this and then update the evaluation again. ###@###.### 2004-11-23 06:14:32 GMT I was able to reproduce this issue, though it seems fixed in b9 of 1.6.0. Passing on to AWT to see if this should/or already is going into an update release. ###@###.### 2004-11-23 06:36:26 GMT
18-10-2004