This discussion is archived
1 Reply Latest reply: Dec 20, 2012 9:22 AM by gimbal2 RSS

Threads updating Swing

978140 Newbie
Currently Being Moderated
Hi. I noticed that when trying to add text to a textbox:
myJTextArea.append("abc");
From a Thread:
loop 100 times{
call append()
}>
My application hangs.

But when I add an sleep:
loop 100 times{
call append()
Thread.Sleep(10);
}>
It all works fine. Is this correct behavior?
If it is: can I speed up without Sleep? (synchronize?)

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points