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.