Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Beginning Java and the fly likes Erasing the console!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Erasing the console!!" Watch "Erasing the console!!" New topic

Erasing the console!!

Sidd Kulk
Ranch Hand

Joined: Feb 20, 2007
Posts: 152
We all know that using System.out.println(); we can output our values to console. Is there any way we can erase values from console?? Say, I output a string through SOP, and after that I wish to erase it from console. Is it possible??

[ April 27, 2007: Message edited by: Sidd Cool ]
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

I think there is not possibilities to doing this...

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Srikanth Ramu
Ranch Hand

Joined: Feb 20, 2007
Posts: 76
If you want to redirect all the System.out.println() to any file then you can use System.setOut(PrintStream out);

This way you can avoid printing in the console and refer the file the prints
Joe Ess

Joined: Oct 29, 2001
Posts: 9168

You can use ASCII control characters, like 0x0d (carrage return) or 0x08 (backspace) to control the cursor on a single line. If your console recognizes ANSI escape sequences, they allow greater flexability (Windows requires some configuration to get these to work).
If you want a fully-featured GUI, use AWT or Swing.
By the way, Sidd, we have a naming policy here at the Ranch. In short, your name must be a first and last name, separated by a space and not obviously fake. You can change your name here. Thanks for your prompt attention.
[ April 27, 2007: Message edited by: Joe Ess ]

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: Erasing the console!!
jQuery in Action, 3rd edition