title: ContentPane and JProgressBar not visible
body: <p>I have created a <code>JDialog</code> extension that has one component, a <code>JProgressBar</code>, inside the content pane. The <code>JProgressBar</code> is public because I want the value to be set by the owner class. When I create a new Dialog, the content pane doesn't appear at all, resulting in whatever is behind it being displayed instead of the progress bar:</p>
  
  <pre><code>public class ProgressBarDialog extends JDialog {
      public JProgressBar bar;
  
      public ProgressBarDialog(Frame owner, String title) {
          super(owner, title);
          bar = new JProgressBar(JProgressBar.HORIZONTAL, 0, 100);
          bar.setValue(0);
          bar.setStringPainted(true);
          bar.setPreferredSize(new Dimension(200, 100));
  
          getContentPane().setLayout(new BorderLayout());
          getContentPane().add(bar, BorderLayout.CENTER);
  
          setSize(200, 100);
          setLocationRelativeTo(null);
          setVisible(true);
          toFront();
      }
      public void setProgress(int p) {
          bar.setValue(p);
      }
  }
  </code></pre>
  
  <p>The usage code for this <code>ProgressBarDialog</code> is as follows</p>
  
  <pre><code>ProgressBarDialog progBarDialog = new ProgressBarDialog(null,"Submitting");
  //Stuff gets done
  progBarDialog.setProgress(20);
  //Stuff gets done
  progBarDialog.setProgress(45);
  //Stuff gets done
  progBarDialog.setProgress(70);
  //Stuff gets done
  progBarDialog.setProgress(100);
  //Stuff gets done
  progBarDialog.dispose();
  </code></pre>
  
  <p>Is there something I'm missing, because this is (I thought) a fairly simple implementation?</p>
  
  <p>Upon suggestion of camickr, I created a test SSCCE here: <a href="http://www.kstich.com/TestDialog.java" rel="nofollow noreferrer">TestDialog.java</a>. As you can tell, the code is the exact same. The problem is that the test works and displays correctly. I have added all the code that is involved with the other implementation of the Dialog window.</p>