• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to stop the asynchronization in swt Java  RSS feed

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I first initiate:
Display display=new Display();

Then, I need to run the code, just ignore the details of runnable function
Display.getDefault().asyncExec(runnable);


But the problem is that I have to run the code in the next file which I am not allowed to choose which one to be executed first.
Display display= new Display();

Then, I got error message.(like invalid thread or when I disposes the display, I got "Failed to execute runnable (org.eclipse.swt.SWTException: Widget is disposed)")
How can I solve the problem or to stop the asynchronization (P.S I am doing testing)
 
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a hard time understanding what you want. How about you write a SSCCE (<- link) which shows the problem you are having so we can understand it.
 
Ranch Hand
Posts: 177
Hibernate Linux Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he ment the fact that you need the right display to get the right thread.
If the display is not the default one you may have a problem if you are not in the correct thread.
Then again I am not that firm with SWT and there might be a solution to that.
Anyway you should explain a bit better what you want to do.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!