SWT(JFace) UI update from worker thread

  • Follow


Hello.

I'm writing a JFace & SWT application. It has a worker thread who does
some periodic data checking. If it detects some changes on the data,
the UI should be refreshed.

But SWT's UI mechanism is not allowed to call 'refresh' method from
other threads than UI thread. (It raises SWT exception.)

How can I solve this problem?

----

Is there any way to make periodic jobs in the UI thread? (like windows
WM_TIMER message)

Thanks in advance.

iwongu
0
Reply iwongu 7/28/2004 11:34:58 PM

You can use syncExec() and asyncExec().  Use timerExec() to get WM_TIMER messages.

Dick
0
Reply dickwad1234 8/1/2004 1:15:28 PM


You can see this article
http://publib.boulder.ibm.com/infocenter/wsphelp/index.jsp?topic=/org.eclipse.platform.doc.isv/guide/swt_threading.htm

you must use another thread to update your ui...^_^

0
Reply javaswing 8/5/2004 2:47:22 AM

2 Replies
494 Views

(page loaded in 0.059 seconds)

Similiar Articles:





7/21/2012 6:54:50 AM


Reply: