• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I stop executing of my app until JLayeredPane is validated?

 
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How do I stop executing of my app until JLayeredPane is repainted and validated?
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Maybe there is another solution? Here I'll briefly describe the problem.
I wrote an application that has many calculations. After each cycle of those calculations, I change the contents of the JLayeredPane, i.e. remove all existing componants, add new ones and validate JLayeredPane. The problem is that all my calculations continues, but JLayeredPane doesn't get refreshed until the very last calculation has been done. How can I synchronize my calculations cycles with JLayeredPane content refresh?
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes I know that.

I have a method that iterates over some array of objects, perform calculations on them and based on that results, updates GUI. I have had set following statement at the very beginning of the method:

if (SwingUtilities.isEventDispatchThread())

and it returned true. So I realize that I'm not out of the EDT. So, calculations and GUI updates are commig in order. Can not figure where is the problem?
 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't need immediate refresh of my GUI after calculations had performed. It would be nice to wait for a while, but it's important to refresh GUI between two calculations. Is there any way to call EDT explicitly, something like yield from main to EDT thread?
[ April 09, 2007: Message edited by: Velika Srbija ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic