Hi I am trying to implement a progress bar into my java code. My java code consists of a graphical user interface that runs an executable file via processBuilder, and streamGobbler. When I implement this code for the progress bar:
private void updateProgressBar(final int newValue){
SwingUtilities.invokeLater(new Runnable() {
public void run(){
progressBar.setValue(newValue);
}
});
}
But it seems as though that the progress bar does not update while the executable is running in the background. I have also implemented processbuilder for the progress bar and that also has not worked. What should I do in order to have this progress bar to work.
Thank you