title: Updating a JFrame
body: <p>I have a <code>JFrame</code> on which I want to simulate a countdown (like a rocket launch). So I set up the frame by hiding various controls (<code>setVisible(false)</code>) and displaying a <code>JLabel</code> with the text (this is the text that is supposed to countdown: 3, 2, 1, Go).</p>
  
  <p>The text on that <code>JLabel</code> starts out at "3". My intent is to simply have the execution of the program wait for 1 second, then change the text to "2", wait another second, change to "1", etc.). At the end, I hide the <code>JLabel</code> and redisplay all of the controls and everything proceeds as normal.</p>
  
  <p>What I am doing isn't working. It seems to wait for the correct amount of time, and when it is done, my JFrame looks great and works as intended. But during the 4 seconds of the countdown method, all I see is a white JFrame. Not the 3, 2, 1 that I want.</p>
  
  <p>Here is my code. Can anyone see what I am doing wrong? Thanks!</p>
  
  <pre><code>public void countdown() {
      long t0, t1;        
  
      myTest.hideTestButtons(true);
      myTest.repaint();
  
      t0 =  System.currentTimeMillis();
      do {
          t1 = System.currentTimeMillis();
      } while ( (t1 - t0) &lt; 1000);
  
      myTest.TwoSeconds();
      myTest.repaint();
      t0 =  System.currentTimeMillis();
      do {
          t1 = System.currentTimeMillis();
      } while ( (t1 - t0) &lt; 1000);
  
  
      myTest.OneSecond();
      myTest.repaint();
      t0 =  System.currentTimeMillis();
      do {
          t1 = System.currentTimeMillis();
      } while ( (t1 - t0) &lt; 1000);
  
  
      myTest.Go();
      myTest.repaint();
      t0 =  System.currentTimeMillis();
      do {
          t1 = System.currentTimeMillis();
      } while ( (t1 - t0) &lt; 1000);
  
      myTest.hideTestButtons(false);
      myTest.repaint();
  }
  
  public void TwoSeconds() {
      lblCountdown.setText("2");
  }
  
  public void OneSecond() {
      lblCountdown.setText("1");
  }
  
  public void Go() {
      lblCountdown.setText("Go!");
  }
  </code></pre>