I want to show a progress bar in my java program but I dont want it to actually work on a real task but i want it to just show that some process is being completed and it should look as if some process is going on. I tried to do this with the following code but it isn’t helping me, so please if u can help….
Code:
try
{
for(int i=0;i<=100;i++){
prog.setValue(i); // this would set the progressbar
Thread.sleep(300); // this should pause the program or the loop
}
}
catch(Exception e){
}
Assuming Swing…
Put the progress bar in indeterminate mode
A progress bar in indeterminate mode displays animation to indicate that work is occurring
http://download.oracle.com/javase/tutorial/uiswing/components/progress.html#indeterminate