title: SwingWorker doInBackground() doesn't work
body: <p>I am trying to show a progress bar while I do some tasks on a database. The Progress bar, however, freezes and the Things I want to do on the database aren't executed. I understand that, in order to guarantee proper concurrency in Swing I need to do the database tasks on a secondary thread. I also understand that somehow my bug has to do with JOptionPane. But I can't come up with a solution to fix it. Here is the Code for my Progress Dialog:</p>
  
  <pre><code>public class ProgressDialog extends JDialog {
  /**
   * 
   */
      private static final long serialVersionUID = 1L;
  
      public ProgressDialog() {
  
          setModal(true);
          setTitle("Fortschritt");
          setSize(200, 100);
          setDefaultCloseOperation(DISPOSE_ON_CLOSE);
  
          JProgressBar pb = new JProgressBar();
          pb.setIndeterminate(true);
          pb.setValue(0);
          add(pb);
  
          setVisible(true);
     }
  }
  </code></pre>
  
  <p>And here is the Code where I call this constructor:</p>
  
  <pre><code>int result = JOptionPane.showConfirmDialog(GUIAutoTest.jtable,
      "Schaden mit Testkonfig = " + index + " anlegen ?", "Bestätigen",
      JOptionPane.YES_NO_OPTION);
  
  if (result == JOptionPane.YES_OPTION) {
  new SwingWorker&lt;Void, Void&gt;() {
      final  ProgressDialog pd = new ProgressDialog();
      @Override
      protected Void doInBackground() throws Exception {
          InitTestLauf itl;
          try {
              itl = new InitTestLauf(index);
              StartTestLauf stl = new StartTestLauf(itl.getIdTstLauf());
          } catch (SQLException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
          return null;
      }
  
      @Override
      protected void done() {
          System.out.println("done");
          pd.setVisible(false);
      }
  }.execute();
  
  JOptionPane.showMessageDialog(GUIAutoTest.jtable,
          "Schaden angelegt. " + "Schadennummer: " + StartTestLauf.getSchadenNr(),
          "Schaden angelegt", JOptionPane.PLAIN_MESSAGE);
  </code></pre>
  
  <p>It doesn't matter, what happens inside the doInBackground()-block , not even System.out.println("print something") does work. Where is my mistake ?</p>
  
  <p>Thanks in advance!</p>