title: How can I make a delay in a Swing GUI?
body: <p>I have a <code>JFrame</code> and some labels I want to display these labels one by one (but delay time) when I press a button. I tried using this code:</p>
  
  <pre><code>        label_1.setVisible(1000);
          Thread.sleep(time);
          label_2.setVisible(1000);
          Thread.sleep(time);
          label_3.setVisible(1000);
          Thread.sleep(time);
          label_4.setVisible(1000);
  </code></pre>
  
  <p>But the application waits the time of time (4000 ms) then display all labels at once.</p>