Hello Everyone,
I get the following error on trying to access a different class on click of button
Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
My code goes like this:
Calling class where main display is coded:
|
Code:
|
butt_tenant_dets.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
TenantDets callTabObj = new TenantDets();
callTabObj.tenant_table();
}
}); |
Trying to access following code
|
Code:
|
public class TenantDets extends ProDomesticMain{
public void tenant_table(){
Table tenantsTable = new Table(work_space,SWT.BORDER);
tenantsTable.setLinesVisible(true);
}
} |
I learnt that following code must be used to solve the problem. But this didnt help me.
|
Code:
|
display.syncExec(
new Runnable() {
public void run(){
label.setText(text);
}
}); |
Please help.