To modify widget from Thread


I would like to knowhow I can to modifythe state of a widget SWT (Canvas, Label…) from a Thread. Actually, I obtain “Invalid Thread Access” exception.


SWT isn’t thread safe, since most GUI event loops are not thread safe.

Display.getDefault().syncExec( new Runnable() { public void run() { /* … */ } } );

It’s in the main SWT docs.