I want a indeterminate progress bar to pop up as soon as the user presses the "run" button and then close when the work to be done by the application is finished. I used NetBeans to develop the GUI. How should I go about it? The gui class extends JFrame. Here is the action listener for the run button:
public class GUI extends JFrame{
// other methods and constructos....
private JProgressBar pb = new JProgressBar();
private void runButtonActionPerformed(java.awt.event.ActionEvent evt) {
pb.setIndeterminate(true);
//other functions start...
runButton.setEnabled(false);
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
//....blah blah
}
}
How do I add the progressbar to my JFrame, and then remove it when my work is done? I do NOT want to use Swing Worker.