Bookmark Topic Watch Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
There are several alternatives. You can print a bunch of blank lines and push all the text off the screen that way. If you don't mind some degree of platform lock-in, you can use JNI to make a system call, which of course ties you to one specific platform. You may be able to use Runtime.exec() to execute an external command.

Another option which works on many platforms is to use ANSI terminal-control escape sequences. By merely printing a few special characters, you can clear a window, print colored text, and perform other nifty tricks on any platform that supports ANSI escape characters, which includes Linux, Mac OS/X, and Windows (if the ANSI.SYS driver is installed.)

A pure Java library for console control (which also supports color and other console options) is the JChassis ANSI Terminal Controller.

There is a Java Curses Library available for both Unix-like and Windows platforms (curses being a terminal library on Unix-like systems). This is a full-fledged AWT-like text console windowing toolkit including dialogs, lists, scrollbars and so on.
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic