Need help with JDialog modal problem

Joined
Feb 15, 2008
Messages
1
Reaction score
0
I am trying to implement a JDialog which pops up before and after some lengthy operation. This is pretty much like a progressbar but instead I'm using a JLabel to display a .gif file during this lengthy operation.

Currently, if i set the modal to "true", the JDialog appears with the JLabel painted, but this doesn't seem to return to the lengthy operation and simply stays in some sort of a loop. While I do know that this blocks input to the owner and the rest of the application, I'm hoping someone can suggest some workarounds to this.

Also, if i set modal to "false", the JDialog appears, but the JLabel doesn't seem to be painted. The lengthy operation performs as expected and the JDialog disappears after.

Here's a snippet of my code:
if (operation.equals("LOAD")) {

PLN_SCN_ProgressBar bar = new PLN_SCN_ProgressBar(MainUI.getUIFrame(),false);
bar.setSize(400, 90);
bar.setLocation(480,300);
bar.setVisible(true);
System.out.println("LOADING COMPONENTS************");
// LENGHTY OPERATION HERE
.
.
// END OF LENGTHY OPERATION
bar.setVisible(false);

.
.
.


I hope I've supplied enough information for you all but feel free to ask for more if needed. Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top