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

Swing does not stop painter thread

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P5 P5
    • None
    • 1.4.0
    • client-libs



      Name: jk109818 Date: 04/18/2003


      FULL PRODUCT VERSION :
      java version "1.4.2-beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-beta-b19)
      Java HotSpot(TM) Client VM (build 1.4.2-beta-b19, mixed mode)

      FULL OS VERSION :
      Microsoft Windows 2000 [Version 5.00.2195]

      A DESCRIPTION OF THE PROBLEM :
      In your comment to Bug Report no. 4843790 you wrote:

      In 1.4 AWT added code such that the Event Dispatching Thread would stop in
      certain cases, thereby allowing the app to exit.
      The test case does not trigger this as it does not dispose of the window that
      it creates. If you add:
                      jf.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
      It will.

      Unfortunately that does NOT close the application - still AWT keeps running and such the java.exe does not terminate. This leads to the problems described in 4843790.

      REGRESSION. Last worked in version mantis-beta

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      import javax.swing.JDialog;
      public class SwingTest {
      public static void main(String[] args) {
      final JDialog d = new JDialog();
      d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
      d.show();
      }
      }

      Compile this.
      Go to the command line on W2K: cmd.exe
      type java.exe SwingTest and press return
      You'll se that a tiny dialog opens.
      Click the close button of the dialog.
      The dialog closes.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      java.exe should terminate, so that I can type in the next command into the command line now.
      java.exe does not terminate.

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import javax.swing.JDialog;
      public class SwingTest {
      public static void main(String[] args) {
      final JDialog d = new JDialog();
      d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
      d.show();
      }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      d.setDefaultCloseOperation(JDialog.EXIT_ON_CLOSE);

      what leads to the whole VM stopping, even if there are other swing threads running OR write a launcher software that listens for any terminating swing program by a proprietary mechanism and System.exit() when all swing apps are closed.
      (Review ID: 183797)
      ======================================================================

            svioletsunw Scott Violet (Inactive)
            jkimsunw Jeffrey Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: