Is it possible to split the output console, say - in 2 parts, for updating each part separately?
Imagine 2 threads, each updating one of the parts.
PS: There shouldn't be any visual separation in between the parts!
Above, 23% is one part and * is another part. They will be continuously updated until they become:
Hint: Progress bar.
Originally posted by Stefan Wagner:
Don't write to System.out, but to a buffering class, which handles the output.
Thanks for the help. You mean, without JNI? Please give me some more hints.
Some startup code would be more helpful.
PS: Your signature made me laugh! Hehe..nice logic though.
Please look here:
A post related with this topic is
Originally posted by Stan James:
You can try to send a bunch of backspace characters (0x08) to wipe out the current text, then rewrite it. That more or less works in Windows, don't know about *nix or any other environments.
\r works in Windows and Mac (which is Unix based). This is just a return -- you would then need to overwrite what was on that line. See how this looks...
Originally posted by Faisal Pasha:
...A post related with this topic is
Please don't cross-post.
I think you're making this overly complicated. Why would you use separate threads to update each "part" of the String? The numeric representation (23%) and the bar display (*****) are both based on the same value, so all you need is to build a String based on this value.
[ April 15, 2007: Message edited by: marc weber ]
I had concentrated on this question, and didn't mention, that the real problem is to update the same line.
Your code is nice portable - this one:
needs Ansi.sys loaded on Windows, runs without any installation on most linuxes, and I don't know for mac, solaris, ...