• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Velika Srbija
Ranch Hand
Posts: 172
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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 ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!