• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Urgent help in ProgressMonitor  RSS feed

 
shaiju ck
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've got a little prob using ProgressMonitor. I'm coding an Frame which do some batch sql processing. Since this task may take a while, I'm trying to use ProgressMonitor to show a dialog window with the corresponding progressbar to indicate how much work's done already.
My code looks like this:
if (progressMonitor.isCanceled())
{
progressMonitor.close();
Toolkit.getDefaultToolkit().beep();
}
else
{
progressMonitor.setNote(this.statMessage);
progressMonitor.setProgress(this.counter);
}
synchronized(this)
{
try
{
System.out.println("Wait...");
Thread.sleep(1000);
}
catch(Exception e)
{
System.out.println("Thread exception "+e);
}
}
The sql process works fine. My only prob is with the ProgressMonitor which starts showing after the default time (might be one second) - but the frame it shows is corrupt. You can see the outlines of it, but none of the contents is displayed - not to talk of the progressbar. Simply nothing.
Did anyone encounter this prob as well and has some ideas what's wrong? Any help would be appreciated.
Cheers,
Shaiju
 
Chris Shepherd
Ranch Hand
Posts: 286
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not seeing where your sql code comes in to this. Can you show us a bit more of your code besides what we have so far? It might help us understand more.
 
Wayne L Johnson
Ranch Hand
Posts: 399
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the "paintImmediately(...)" method

Since you haven't shown the full code it's hard to guess what GUI element to use. You may want to do the "getBounds()" and "paintImmediately()" on the Frame containing the progressMonitor instance.
Hope this helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!