I start the progress bar when the start button is pressed, and when my task is completed, I call a function in which I try to stop the indefinite progress bar mode, but I still can not do this (I'm using SwingWorkerfor my application)
Here is my code to run the progress bar; this code is written inside the start button:
private void StartButtonMouseClicked(java.awt.event.MouseEvent evt) {
Main f22 = new Main();
f2.getfile(FileName, 0);
f2.execute();
SwingUtilities.invokeLater(new Runnable()
{
@Override
public void run()
{
jProgressBar1.setIndeterminate(true);
}
});
This is the code inside the function that is called after the task completes.
jProgressBar1.setVisible(false);
Xara source
share