I am a newbie to Java programming. I have a program that executes a system command using Runtime exec Process
and I want it while the Process
is running, the JProgressBar
indicator is updating. How can I do this programmatically?
My code is something like:
...
try {
Process p = Runtime.getRuntime().exec(command_goes_here);
int error = p.waitFor();
// Then the JProgressBar???
System.out.println((error == 0 ? "Success" : "Failed"));
}