Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

clearing the screen

 
volsteni raj
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone provide code for clearing the screen in java code
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

There's no "clear the screen" API method in Java. You have two choices: you can print enough blank lines to push everything off the screen, or you can directly print a clear-screen control character (if your platform supports one.) Most UNIX terminals, and some versions of Windows if ANSI.SYS is installed, support ANSI control characters. See, for example, this.
 
Preetham Chandrasekhar
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
printing blank lines is the option i know bout
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic