title: JFrame does not draw content, only shows white rectangle, when made visible inside ActionListener
body: <p>I have an application, on the beginning the Jframe is displayed, user enters the URL of a webpage that has to be analysed, then user clicks OK.</p>
  
  <p>When user clicks OK actionListener should do this:
  It should display a new Jframe with a text "please wait , analysing website, this may take a little"
  then it should start the analyzePage() method.</p>
  
  <p>the problem is that after user clicks OK button, the new Jframe is displayed, but it is blank, only with white rectangle inside. Only after analyzePage() method is finished (which is after many seconds) Contents of Jframe are displayed.</p>
  
  <pre><code>    static class OKListener implements ActionListener {
  
      public void actionPerformed(ActionEvent e) {
          new WaitFrame();
  // mf is main frame (the first frame where url was entered and where OK was clicked)
          mf.setEnabled(false);
          address = mf.getURLtext();
          analyzePage();
      }
  }
  
  public class WaitFrame extends JFrame {
  
  public WaitFrame() {
      super();
      JFrame wait = this;
      JLabel jl = new JLabel("Čakajte prosím, analyzujem stránku, môže to chvíľu trvať.");
      JPanel jp = new JPanel();
      jp.add(jl);
      wait.getContentPane().add(jp);
      wait.pack();
      wait.setVisible(true);
  }
  }
  </code></pre>