Thread synchronize with GUI controls

I need to modify some GUI controls (append text to JTextArea) from my custom thread..

Javadoc say that the method append of JTextArea is thread-safe, but if I call it from my thread the application go in blocking-state

So I try to use, SwingUtilities.invokeLater but when I try to append some text to JTextArea, the application go in blocking-state..

How can I do for synchronize method call from my thread to main thread..?

Thanks..

[465 byte] By [Fada] at [2007-11-27 3:40:41]
# 1
By using SwingUtilities.invokeLater() only you can run your application with out blocking state.Post some sample code... to identify problem
GsrCa at 2007-7-12 8:44:08 > top of Java-index,Desktop,Core GUI APIs...
# 2

This is my code:

private void WriteDebugSafe(final String str)

{

Runnable WriteText = new Runnable()

{

public void run()

{

debug.append(str+"\n");

}

};

SwingUtilities.invokeLater(WriteText);

}

After the call to invokeLater.. the application go in blocking-state.

This appened sometimes.. NOT systematically..

Fada at 2007-7-12 8:44:08 > top of Java-index,Desktop,Core GUI APIs...
# 3
There's nothing wrong with the code you posted. The problem is happening somewhere else.
BinaryDigita at 2007-7-12 8:44:08 > top of Java-index,Desktop,Core GUI APIs...
# 4
> but if I call it from my thread the application go in blocking-stateThen your Code is executing in the GUI Event Thread, not a separate Thread.
camickra at 2007-7-12 8:44:08 > top of Java-index,Desktop,Core GUI APIs...
# 5
Check all your threads with SwingUtilities.isEventDispatchThread() if Thread is working for GUI modifications then above method must return TURE. otherwise it must return FLASE.then also if your not able to identify problem then post your code as much as posiible.
GsrCa at 2007-7-12 8:44:08 > top of Java-index,Desktop,Core GUI APIs...