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!
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!