public void updateProgress(ProgressEvent evt){
  if (progressBar != null) {
    int type=evt.getType();
    if (type == ProgressEvent.START || type == ProgressEvent.UPDATE) {
      progressBar.setVisible(true);
      progressBar.setValue(evt.getPercentComplete());
      setLabel(evt.getTaskDescription());
    }
 else {
      progressBar.setVisible(false);
    }
  }
}

public void updateProgress ( ProgressEvent evt ) { if ( progressBar != null ) { int type = evt . getType ( ) ; if ( type == ProgressEvent . START || type == ProgressEvent . UPDATE ) { progressBar . setVisible ( true ) ; progressBar . setValue ( evt . getPercentComplete ( ) ) ; setLabel ( evt . getTaskDescription ( ) ) ; } else { progressBar . setVisible ( false ) ; } } }
receive a progressevent , and use it if possible .
