Hello,
I've looked far and wide for the answer to this question without any
success. Is there a method in Java that clears output to
System.out.println? My goal is to pass output to the line then erase it
so that I don't have repeating lines in my loop. Any help is much
appreciated.
Thanks,
Ben
Gordon Beaton - 11 Sep 2005 14:17 GMT
> I've looked far and wide for the answer to this question without any
> success. Is there a method in Java that clears output to
> System.out.println? My goal is to pass output to the line then erase
> it so that I don't have repeating lines in my loop. Any help is much
> appreciated.
Most terminals let you return to the start of the line when you print
a carriage return (not a newline). You can't do this across multiple
lines though. Use System.out.print("\r") (not println()).
/gordon

Signature
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
wheelscribe - 11 Sep 2005 15:12 GMT
>>I've looked far and wide for the answer to this question without any
>>success. Is there a method in Java that clears output to
[quoted text clipped - 7 lines]
>
> /gordon
That's exactly what I needed to know. Thank you.
== Ben
Roedy Green - 13 Sep 2005 07:54 GMT
>Is there a method in Java that clears output to
>System.out.println?
See http://mindprod.com/jgloss/console.html

Signature
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.