Results 1 to 3 of 3
- 07-18-2008, 03:21 PM #1
Member
- Join Date
- Jul 2008
- Posts
- 29
- Rep Power
- 0
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.
And it looks like this:
Java Code:public static void main(String args[]) { String[] loginDetails = new String[3]; //create array LoginWidgets login = new LoginWidgets(); //create object DetailsScreen details1 = new DetailsScreen();// '' loginDetails = login.RenderWidgets(); //Get username/password/database returned by method in first class details1.DetailsScreenRender(); //call method in second class
It's just, when I run this, it comes up with this error:
And it says the problem is with this line:Java Code: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(Unknown 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 Practise.LoginWidgets.<init>(LoginWidgets.java:11) at Practise.Simian.main(Simian.java:17)
DetailsScreen details1 = new DetailsScreen();
I'm really not sure what's going on. Thanks in advance for anyone that knows what's going on!!
- 08-14-2009, 08:50 AM #2
Member
- Join Date
- Jul 2009
- Posts
- 1
- Rep Power
- 0
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)
Please help.....Thanks in advance.....
- 08-14-2009, 10:16 AM #3
Senior Member
- Join Date
- Dec 2008
- Location
- Kolkata
- Posts
- 280
- Rep Power
- 5
Similar Threads
-
data from the main/GUI thread to another runnin thread...
By cornercuttin in forum Threads and SynchronizationReplies: 2Last Post: 04-23-2008, 10:30 PM -
If JNI thread call the java object in another thread, it will crash.
By skaterxu in forum Advanced JavaReplies: 0Last Post: 01-28-2008, 07:02 AM -
Help with access a database using Microsoft Access
By cachi in forum JDBCReplies: 1Last Post: 08-07-2007, 07:51 AM -
how to access to an object from a thread
By tamayo in forum New To JavaReplies: 1Last Post: 07-24-2007, 04:24 AM


LinkBack URL
About LinkBacks

Bookmarks