java updating text area

Posted by n0ob on Stack Overflow See other posts from Stack Overflow or by n0ob
Published on 2010-03-28T04:01:40Z Indexed on 2010/03/28 4:03 UTC
Read the original article Hit count: 334

Filed under:
|

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.

        while(tick<terminationTime){
         if ((System.currentTimeMillis()) > (msNow + delay)){
            msNow = System.currentTimeMillis();
            tick = tick + 1;
            currentTime.setText(""+tick);
            sourceTextArea.append(""+tick+"  " +  System.currentTimeMillis() +" \n");
         }

currentTime and sourceTextArea are both text areas and both are getting updated after the while loop ends.

© Stack Overflow or respective owner

Related posts about java

Related posts about textarea