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

WindowConstants.EXIT_ON_CLOSE is missing!

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 1.2.2
    • docs
    • generic, x86
    • generic, windows_nt



      Name: mc57594 Date: 07/12/99


      Documentation for javax.swing.JFrame.setDefaultCloseOperation() claims that there's a value WindowConstants.EXIT_ON_CLOSE. However, javax.swing.WindowConstants.EXIT_ON_CLOSE does not exist.

      ===============================================
      The web site is wrong:
      http://java.sun.com/products/jdk/1.2/docs/api/javax/swing/JFrame.html#setDefaultCloseOperation(int)

      If you download the docs:
      file://docs/jdk1.2.1/docs/api/javax/swing/JFrame.html#setDefaultCloseOperation(int)
      there is no mention of EXIT_ON_CLOSE for that method.

      ---------------------------
      setDefaultCloseOperation

      public void setDefaultCloseOperation(int operation)

            Sets the operation which will happen by default when the user initiates a "close" on this frame. The
            possible choices are defined in the WindowConstants interface:

                  DO_NOTHING_ON_CLOSE - do not do anything - require the program to handle the operation in
                  the windowClosing method of a registered WindowListener object.
                  HIDE_ON_CLOSE - automatically hide the frame after invoking any registered WindowListener
                  objects
                  DISPOSE_ON_CLOSE - automatically hide and dispose the frame after invoking any registered
                  WindowListener objects

            The value is set to HIDE_ON_CLOSE by default.
      ----------------------------------

      [Chamness]
      ===============================================

      (Review ID: 85456)
      ======================================================================

      Name: skT88420 Date: 09/14/99


      It is referenced in the 1.2.2 docs
       (http://www.javasoft.com/products/jdk/1.2/docs/api/javax/swing/JFrame.html#setDefaultCloseOperation(int))
       that the JFrame.setDefaultCloseOperation()
       can utilize the WindowsConstants.EXIT_ON_CLOSE constant - which, if it did
       call a System.exit() like function, would get programmers around the AWT bug
       (bug 4030718) that keeps the JVM alive even after all non-daemon threads
       have died, requiring a Ctrl-C to exit. But there is no
       WindowsConstants.EXIT_ON_CLOSE constant in the JDK 1.2.2. Not in the docs,
       and not in the source code.
      (Review ID: 95232)
      ======================================================================

      Name: skT88420 Date: 10/12/99


      According to the documentation ( "$DOCPATH/api/javax/swing/JFrame.html#setDefaultCloseOperation(int)" )
      there should be four constants for diffent actions , and the one that I would need in this case is
      EXIT_ON_CLOSE . But when I tried to compile a source that contained a line like :
      setDefaultCloseOperation ( WindowConstants.EXIT_ON_CLOSE ) ;
      I got an error stating that there was no such constant .
      According to JFrame's docs there shoulb be one , but according to
      WindowConstants docs there isn't . And obviously not according to the compiler either .
      I think I've used this in earlier releases , but there are ways to handle closing without it .
      (Review ID: 96415)
      ======================================================================

            kwalrathsunw Kathy Walrath (Inactive)
            mchamnessunw Mark Chamness (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: