org.eclipse.swt.SWTException: Invalid thread access

I've got three classes, two have methods in them. Class one renders widgets and shell for a login screen and the method returns a three element array. Class two has a method in it that is called after Class ones' method has return the array.

I have same problem... I have class in some package and I am accessing it in another class that time it shows this error.....

Exception in thread "main" org.eclipse.swt.SWTException: Invalid thread access
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.widgets.Display.checkDisplay(Unkno wn Source)
at org.eclipse.swt.widgets.Display.create(Unknown Source)
at org.eclipse.swt.graphics.Device.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at org.eclipse.swt.widgets.Display.<init>(Unknown Source)
at internalframes.ScrollableTable.<init>(ScrollableTa ble.java:31)
at MainFrame.createFrame(MainFrame.java:184)
at MainFrame$4.handleEvent(MainFrame.java:77)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unkno wn Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Control.WM_MENUSELECT(Unkn own Source)
at org.eclipse.swt.widgets.Control.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Decorations.windowProc(Unk nown Source)
at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(N ative Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(Un known Source)
at org.eclipse.swt.widgets.Shell.callWindowProc(Unkno wn Source)
at org.eclipse.swt.widgets.Control.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Decorations.windowProc(Unk nown Source)
at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.win32.OS.DefWindowProcW(N ative Method)
at org.eclipse.swt.internal.win32.OS.DefWindowProc(Un known Source)
at org.eclipse.swt.widgets.Shell.callWindowProc(Unkno wn Source)
at org.eclipse.swt.widgets.Control.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Canvas.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Decorations.windowProc(Unk nown Source)
at org.eclipse.swt.widgets.Shell.windowProc(Unknown Source)
at org.eclipse.swt.widgets.Display.windowProc(Unknown Source)
at org.eclipse.swt.internal.win32.OS.DispatchMessageW (Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage( Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Un known Source)
at MainFrame.<init>(MainFrame.java:163)
at MainFrame.main(MainFrame.java:16)