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

javax.swing.ProgressMonitor do not cancel on close

XMLWordPrintable

    • beta
    • x86
    • windows_nt



      Name: yyT116575 Date: 01/03/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      If a javax.swing.ProgressMonitor is closed it is not possible to detect this
      from the process being monitored. In my opinion closing the ProgressMonitor
      dialog should be the same as selecting the cancel button.

      There is no way of detecting that the user has closed the progress dialog since
      it is private inside the ProgressMonitor class.

      Problem is inside the internal ProgressOptionPane class in the ProgressMonitor
      class. It does not implement a correct behaivour for the windowClosing event.

      // from javax.swing.ProgressMonitor.java
      private class ProgressOptionPane extends JOptionPane {
      ...
                      public void windowClosing(WindowEvent we) {
                          setValue(null);
                      }
      ...
      }

      If this was changed to the code bellow it would work! Closing the OptionPane
      would then be the same as canceling.
      ...
                      public void windowClosing(WindowEvent we) {
                          setValue( cancelOption[0] );
                      }
      ...
      (Review ID: 114483)
      ======================================================================

            peterz Peter Zhelezniakov
            yyoungsunw Yung-ching Young (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: