title: How to use ProgressMonitor window without losing focus on the main JFrame?
body: <p>I don't know how to do that, because ProgressMonitor window is self-invoked (after 2 seconds, if necessary) and I don't have any control when and if it will open. Therefore I don't have a clue how to make it open in background, so the focus stays on the main JFrame.</p>
  
  <pre><code>MyFile file = panel.getFilesystem().getFile(panel.getDirectory()+fileName);
  if(file.isDirectory()){
      final ProgressMonitor monitor = new ProgressMonitor((Component)event.getSource(), 
              "Determining the size of "+file.getName(), "Initializing...", 0, 100);
      monitor.setMillisToPopup(500);
      monitor.setMillisToDecideToPopup(200);
      final DirectorySizeWorker worker = new DirectorySizeWorker(file, table, monitor, table.getSelectedRow(), 2);
      worker.execute();
      worker.addPropertyChangeListener(
               new PropertyChangeListener() {
                   public  void propertyChange(PropertyChangeEvent event) {
                       if ("progress".equals(event.getPropertyName())) {
                           monitor.setProgress((Integer)event.getNewValue());
                           monitor.setNote((Integer)event.getNewValue() + "% completed");
                       }
                       if("state".equals(event.getPropertyName())){
                           monitor.close();
                       }
                   }
               });
  }
  </code></pre>
  
  <p><code>monitor</code> is monitoring behaviour of <code>worker</code>. <code>worker</code> is a <code>SwingWorker</code> implementation trying to deremine the <code>file</code> size (in this particular case file is a directory, that's why I assume it may take a long time and use a <code>SwingWorker</code>), if it takes too long <code>monitor</code> invokes a new window with progress bar and notification about the progress. Problem is that this window is focused on and I would rather like it to be opened in background, so the user can still browse files (the program is a simple file manager).</p>