• Post Reply Bookmark Topic Watch Topic
  • New Topic

Invalid thread access

 
Oleg Glizerin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi im new to threads, so im confused please take a look at what i am doing wrong:
This is a project about 2048 game to be more accurate, and i want this project to run in this thread that i make in main...


My main:



the project is kinda big so i will show the relevant classes:









and the error is:

Exception in thread "Thread-0" 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.error(Unknown Source)
at org.eclipse.swt.widgets.Display.checkDevice(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at view.Game2048View.run(Game2048View.java:55) //he say the problem at Run
at java.lang.Thread.run(Unknown Source)



he say here is the problem....


any idea?
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Oleg,

First of all, I'm not at all aware about SWT UI development. That given, did you try to run this code from outside of Eclipse (frankly, I'm not even sure if it is possible at all ).

Also, this(<-click) might be helpful for this issue.
 
Oleg Glizerin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did not.. any reason why should i do that?
 
Anayonkar Shivalkar
Bartender
Posts: 1558
5
Eclipse IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oleg Glizerin wrote:i did not.. any reason why should i do that?

Sorry - I'm not SWT programmer

Moving this thread to SWT forum where you'll get SWT specific help.
 
Oleg Glizerin
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok thanks, hope some one know something about this
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!