I want to stop the indeterminate mode of the progress bar, once my doInBackground
(method of SwingWorker) returns null
(meaning when my task is done). Here is my code inside the button; when I run my code, I get an error. Here is the code:
private void StartButtonMouseClicked(java.awt.event.MouseEvent evt) {
final Main f22 = new Main();
initializer();
f22.getfile(FileName, 0);
f22.execute();
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
jProgressBar1.setIndeterminate(true);
try {
if (f22.doInBackground() == null) {
jProgressBar1.setIndeterminate(false);
}
} catch (IOException ex) {
Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
}
}
});
Here is the error that I get:
# # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6e1b0750, pid=4988, tid=5464 # # JRE version: 7.0-b141 # Java VM: Java HotSpot(TM) Client VM (21.0-b11 mixed mode, sharing windows-x86 # Problematic frame: # V [jvm.dll+0xa0750] # # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows #