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

DISPOSE_ON_CLOSE hangs java in windows

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2
    • None
    • 1.4.1
    • client-libs
    • x86
    • windows_98

    Description

      When the default close operation is set as DISPOSE_ON_CLOSE in a JFrame, closing the JFrame hangs java. This is seen in build 11 of hopper. The test case given below exits cleanly in build 10. This can be seen from the console output pasted below :

      [Z:/work/temp] jdk_1.4.1/b10/binaries/win/bin/java -showversion temp4
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b10)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b10, mixed mode)

      Closing the window
      [Z:/work/temp] jdk_1.4.1/b11/binaries/win/bin/java -showversion temp4
      java version "1.4.1-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-beta-b11)
      Java HotSpot(TM) Client VM (build 1.4.1-beta-b11, mixed mode)

      Closing the window

      How to reproduce the problem :
      1. Compile and run the source code given.
      2. A JFrame appears. Close this frame.
      3. Although the frame gets closed, the console does not return to the command prompt as it should.

      -----------------BEGIN SOURCE-----------------------
      import javax.swing.*;
      import java.awt.event.*;
      public class test extends JFrame{
              public static void main (String [] args){
                      new test();
              }

              public test(){
                      super("Test Frame");
                      setSize(100,100);
                      addWindowListener(new WindowAdapter(){
                              public void windowClosing(WindowEvent we){
                                      System.err.println("Closing the window");
                              }
                      });
                      setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                      show();
              }
      }
      ------------------------END SOURCE----------------------

      Attachments

        Issue Links

          Activity

            People

              dassunw Das Das (Inactive)
              kjethisunw Kanishk Jethi (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: