Re: Clear Screen command
- From: Chris Smith <cdsmith@xxxxxxx>
- Date: Sat, 28 May 2005 08:37:08 -0600
Frank Meyer <f.meyer@xxxxxxxx> wrote:
> does anyone know how to clear the screen where I wrote comments with
> System.out.prinln("..."); ?
The following code ought to work:
public void clearScreen()
{
final int NUM_LINES = 100; // Just to be safe
for (int i = 0; i < NUM_LINES; i++) System.out.println();
}
Seriously, Java is not designed for serious console-mode user interfaces
(aka TUI). If you need that, then you'll need to take a look at JNI
native libraries for the task... several will turn up if you Google for
"jcurses". Java's core API console support is intended only for simple
debug/log information, and for writing UNIX-style stream-based
applications a la sed, awk, sort, wc, etc. where the standard I/O
streams are redirected or piped. You've hit a limitation that arises
because of this fact.
--
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
.
- Follow-Ups:
- Re: Clear Screen command
- From: Frank Meyer
- Re: Clear Screen command
- References:
- Clear Screen command
- From: Frank Meyer
- Clear Screen command
- Prev by Date: Re: Adding Scrollbars to a canvas
- Next by Date: notinited
- Previous by thread: Clear Screen command
- Next by thread: Re: Clear Screen command
- Index(es):