Re: Clear Screen command



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
.