Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

How to stop the asynchronization in swt Java

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 4179
22
IntelliJ IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 Python Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic