I have a Java program running in command line mode. I would like to display a progress bar, showing the percentage of job done. The same kind of progress bar you would see u
public class Main {
public static void main(String[] args) throws Exception {
System.out.println("Loading : ");
int count =1;
for(int j=1;j<150;j++){
System.out.print("\r");
if(count==1){
System.out.print("/");
count++;
}
else if(count==2){
System.out.print("|");
count++;
}
else if(count==3){
System.out.print("-");
count++;
}
else if(count==4){
System.out.print("\\");
count++;
}
else if(count==5){
System.out.print("|");
count++;
}
else
count = 1;
Thread.sleep(200);
}
}
}