title: java updating text area
body: <p>for my application I have to build a little customized time ticker which ticks over after whatever delay I tell it to and writes the new value in my textArea. The problem is that the ticker is running fully until the termination time and then printing all the values. How can I make the text area change while the code is running.</p>
  
  <pre><code>while(tick&lt;terminationTime){
      if ((System.currentTimeMillis()) &gt; (msNow + delay)){
          msNow = System.currentTimeMillis();
          tick = tick + 1;
          currentTime.setText(""+tick);
          sourceTextArea.append(""+tick+"  " +  System.currentTimeMillis() +" \n");
      }
  }
  </code></pre>
  
  <p>currentTime and sourceTextArea are both text areas and both are getting updated after the while loop ends.</p>