Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4636269

Deadlock when showing a modal dialog from a windowDeactivated event

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 1.4.2
    • 1.4.0
    • client-libs
    • None
    • mantis
    • generic
    • generic

    Description

      I am filing this report based on an email. It is JDK1.4 RC1 feedback.
      See Comments for the email.

      I listed the platform as generic because it wasn't included in the email.

      import java.awt.*;
      import java.awt.event.*;
      import javax.swing.*;

      public class AwtLockBug {

          public AwtLockBug() {
              new MyFrame();
              new MyFrame();
          }

          public class MyFrame extends JFrame {
              public MyFrame() {
                  super();
                  final MyFrame frame = this;
                  addWindowListener(new WindowAdapter() {
                                        public void windowClosing(WindowEvent e) {
                                            System.exit(0);
                                        }
                                        public void windowDeactivated(WindowEvent e) {
                                            new ModalDialog(frame);
                                        }
                                    });
                  setBounds(0,0,100,100);
                  setVisible(true);
              }
          }

          public class ModalDialog extends JDialog {
              public ModalDialog(Frame frame) {
                  super(frame, "ModalDialog", true);
                  setBounds(100,100,100,100);
                  setVisible(true);
              }
          }

          public static void main(String args[]) {
              new AwtLockBug();
          }
      }

      Attachments

        Issue Links

          Activity

            People

              son Oleg Sukhodolsky (Inactive)
              ehawkessunw Eric Hawkes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: