[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform] Re: SWT Error

Try something similar to this which forces your updates to be called on the proper thread for the SWT widget.

Display display = viewer.getTree().getDisplay();
display.asyncExec (new Runnable () {
	public void run () {
		if (viewer.getTree().isDisposed()) return;
		viewer.setSelection(selection, true);
	}
});

vikram wrote:
Hi,
I am trying to populate an SWT Table with data coming from an object that is running in a different thread. ( CORBA Object )


I get the following exception :

org.eclipse.swt.SWTException: Invalid thread access
    at org.eclipse.swt.SWT.error(SWT.java:2942)
    at org.eclipse.swt.SWT.error(SWT.java:2865)

when I try to write the data into the table.

Thanks in advance.