I have one panel class called ITKstartProfile where I added my TextArea on the Panel.
At the and of the Panel logic I start a Thread with a ITKInformationThread class
ITKInformationThread informationThread = new ITKInformationThread(editor) ;
informationThread.start();
public class ITKInformationThread extends Thread {
TextArea text = null;
long i = 0;
ITKInformationThread(TextArea t) {
text = t;
}
@SuppressWarnings("static-access")
public void run() {
while (true) {
text.setValue("thread" + i + "\n");
i++;
try {
this.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
When I do a System.err.print I see the variable I counting.
On my TextArea the values are not updated or added. I only see the first time thread0 but the thread1, thread2 etc are not displayed.
What do I wrong here?
Is it not possible to add information in a TextArea from a separate thread?
Chris