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

JInternalFrame.dispose() incorrectly fires INTERNAL_FRAME_CLOSING

XMLWordPrintable

    • 1.2.2
    • generic
    • solaris_2.5

      The JInternalFrame.dispose() method calls the INTERNAL_FRAME_CLOSING
      as seen below from swing 1.1beta3 source below -

      /*
       * @(#)JInternalFrame.java 1.79 98/08/31
       *
       */

          /**
           * Disposes of this internal frame. If the frame is not already
           * closed, a frame-closing event is posted.
           */
          public void dispose() {
              if (isVisible()) {
                  setVisible(false);
              }
              if (isSelected()) {
                  try {
                      setSelected(false);
                  } catch (PropertyVetoException pve) {}
              }
              if (!isClosed) {
                fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSING);
                fireInternalFrameEvent(InternalFrameEvent.INTERNAL_FRAME_CLOSED);
              }
          }

      In case of java.awt.Frame only WINDOW_CLOSED is fired.
      See attached example.

      This causes an infinite loop because I am calling iFrame.dispose()
      in the INTERNAL_FRAME_CLOSING handler.

      sandip.chitale@Eng 1998-10-19

            tballsunw Tom Ball (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: