title: Java: mytextarea.setText("hello") + Thread.sleep(1000) = strange result
body: <p>I have something like this:</p>
  
  <pre><code>for(int i=0; i&lt;5; i++){
      mytextarea.setText("hello " + i);
      try{
          Thread.currentThread().sleep(1000); //to give time for users to read
      } catch(Exception e){}
  }
  </code></pre>
  
  <p>I'm expecting it will display "hello 0" in the text area, wait for 1 second, then display "hello 1", then wait for 1 second, etc.</p>
  
  <p>But what happen is different, it waits for 5 seconds, then it displays "hello 4".</p>
  
  <p>Any idea?</p>