java - Eclipse console window that respects cursor position calls allowing a progress bar -



java - Eclipse console window that respects cursor position calls allowing a progress bar -

i'm using code this website (nurullah akkaya):

public static void main(string[] args) { (int = 0; < 100; i++) { seek { thread.sleep(100); } grab (exception e) { } printprogbar(i); } } public static void printprogbar(int percent){ stringbuilder bar = new stringbuilder("["); for(int = 0; < 50; i++){ if( < (percent/2)){ bar.append("="); }else if( == (percent/2)){ bar.append(">"); }else{ bar.append(" "); } } bar.append("] " + percent + "% "); system.out.print("\r" + bar.tostring()); }

for whatever reason outputted line line so:

[> ] 0% [=====> ] 10% [==========> ] 20% [===============> ] 30% [====================> ] 40% [=========================> ] 50% [==============================> ] 60% [===================================> ] 70% [========================================> ] 80% [=============================================> ] 90%

when want updating single line, per normal console window.

is there anyway emulate behaviour works in eclipse window?

from sources of console view of eclipse, can see pure "cr" not supported in emulator. so, reply is: no, not possible.

java eclipse console terminal progress-bar

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -