Re: Clear Screen command
- From: darrell@xxxxxxxxxxxxxxxxxx (".")
- Date: 30 May 2005 17:13:38 GMT
On Sat, 28 May 2005, Frank Meyer wrote:
> Chris,
>
> > public void clearScreen()
> > {
> > final int NUM_LINES = 100; // Just to be safe
> > for (int i = 0; i < NUM_LINES; i++) System.out.println();
> > }
>
> this does it - thanks :o)
If you don't have control over the number of lines on the display this is
not a good solution.
On my system my terminal console can be resized to have 160 lines of text.
This code would fail to clear the screen on my system. If my console was
somehow restricted to 100 lines then this would be an acceptable solution.
Bottom line, don't make assumptions. Whenever you see something like "Just
to be safe" it usually indicates that someone is making an assumption or
that the solution is not the best solution.
I'd use this solution for an in-house tool or something I whipped up for
personal use. I would not put this in something I shipped to a customer.
--
Send e-mail to: darrell dot grainger at utoronto dot ca
.
- Follow-Ups:
- Re: Clear Screen command
- From: The Wogster
- Re: Clear Screen command
- From: Chris Smith
- Re: Clear Screen command
- References:
- Clear Screen command
- From: Frank Meyer
- Re: Clear Screen command
- From: Chris Smith
- Re: Clear Screen command
- From: Frank Meyer
- Clear Screen command
- Prev by Date: Re: Vector#toArray()
- Next by Date: Getting index from a select object?
- Previous by thread: Re: Clear Screen command
- Next by thread: Re: Clear Screen command
- Index(es):