hi I have these lines of codes in java netbeans which save the result of p2 in Result.txt
System.setOut(new PrintStream(new FileOutputStream("Result.txt")));
String line1;
Process p2= Runtime.getRuntime().exec(command);
BufferedReader in = new BufferedReader(new InputStreamReader(p2.getInputStream()) );
while ((((line1 = in.readLine()) != null))||i<101)
{
System.out.println(line1);
i=i+10;
jProgressBar1.setValue(i);
}
in.close();
JOptionPane.showMessageDialog(null,"successfull");
The code shows me the progress bar only when i=100 that is when the progress bar is filled and the while loop is completed.
I want the code to show me progress bar at 10,20,30,40,50,60,70,80,90,100 while saving.
Thank you.