if (dialog == null || f == null) { return; }
   public synchronized void updateProgress(int prog) {      progress = prog;      repaint();      // wait for it to be painted to ensure progress is updated      // continuously      try {         wait();      }      catch(InterruptedException ie) {         System.out.println(" updateProgress " + ie.getMessage()  );      }   }