|
|
|
Re: Exception in thread "AWT-AppKit" org.eclipse.swt.SWTException: Invalid thread [message #722230 is a reply to message #721901] |
Mon, 05 September 2011 06:13 |
Eclipse User |
|
|
|
Originally posted by:
On 2011-09-03 15:54, Bill Swanson wrote:
> Wrapping the code with:
> Dispay.getDefault().syncExecExec(new Runnable(){
> public void run(){
> ...code here
> }
> });works.
I'm not sure what kind of typo "syncExecExec" is supposed to be, but
please use "asyncExec" instead of "syncExec", if you can. Using the
latter gives you more chances of a dead lock.
> But after reading from a file in code, I am getting an invalid
> thread access error at
> org.eclipse.swt.widgets.Display.mouseHoverProc(Unknown Source). I have
> wrapped the MouseHover and MouseEnter events with the above call which
> solved a few errors. But the file access call brings up the error on
> mouseHoverProc. Any suggestions or ideas?
Yes: You need to devide your code into clear AWT and clear SWT zones. If
you switch the border between both, use Display#asyncExec to tunnel from
AWT to SWT and use EventQueue#invokeLater to tunnel from SWT to AWT.
HTH & GReetings from Bremen,
Daniel Krügler
|
|
|
Powered by
FUDForum. Page generated in 0.04223 seconds