I am having some trouble getting a JProgressBar to display the second time I make the JFrame that contains it visible. The same thing happens if I replace the JProgressBar with a JLabel.
Here's what happens:
I create the JFrame and JProgressBar, setting their initial states, but leave them hidden.
When it's time to show them I make the container JFrame visible, which makes the JProgressBar visible. Everything works fine.
After the task is done I hide the JFrame.
When it's time to do that task again, I make the JFrame visible again... but this time, there's an empty space where the JProgressBar should be.
I've tried the following things to make this work properly:
Recreating the JFrame and JProgressBar every time I want to display it
Force-repainting the JFrame
Packing the JFrame (to see if the JProgressBar was being removed from the JFrame)
None of these worked. I'm utterly baffled. 😕
By the way, I'm using Eclipse Europa as my IDE, if that makes any difference.
Here's what happens:
I create the JFrame and JProgressBar, setting their initial states, but leave them hidden.
When it's time to show them I make the container JFrame visible, which makes the JProgressBar visible. Everything works fine.
After the task is done I hide the JFrame.
When it's time to do that task again, I make the JFrame visible again... but this time, there's an empty space where the JProgressBar should be.
I've tried the following things to make this work properly:
Recreating the JFrame and JProgressBar every time I want to display it
Force-repainting the JFrame
Packing the JFrame (to see if the JProgressBar was being removed from the JFrame)
None of these worked. I'm utterly baffled. 😕
By the way, I'm using Eclipse Europa as my IDE, if that makes any difference.