code: public void propertyChange( PropertyChangeEvent evt ) {
          if ("progress" == evt.getPropertyName()) {
              int progress = (Integer) evt.getNewValue();
              progressMonitor.setProgress(progress);
              // String message = String.format("Completed %d%%.\n", progress);
              // progressMonitor.setNote(message);
              if (progressMonitor.isCanceled() || task.isDone()) {
                  if (progressMonitor.isCanceled()) {
                      task.cancel(true);
                  }
              }
          }
          if ("progressText" == evt.getPropertyName()) {
              String progressText = (String) evt.getNewValue();
              progressMonitor.setNote(progressText);
              if (progressMonitor.isCanceled() || task.isDone()) {
                  if (progressMonitor.isCanceled()) {
                      task.cancel(true);
                  }
              }
          }
  
      }
docs: Invoked when task's progress property changes.