It's not a secret anymore!
The moose likes Java in General and the fly likes Clearing DOS Window Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Clearing DOS Window" Watch "Clearing DOS Window" New topic
Author

Clearing DOS Window

seema mani
Ranch Hand

Joined: Sep 30, 2001
Posts: 49
hi
I want to clear the dos screen using java.
I saw 2 solutions on the net(given below) , but both did not work. Can someone advise how I can go about doing this ? I'm
working on Windows2000.
Thanks in advance.
Seema
1. char esc = 27; // ESC code
String clear = esc + "[2J" // note case
System.out.print(clear); // Dos screen should be cleared
2. Runtime.getRuntime().exec( "cmd.exe /c cls" ) ;

[This message has been edited by seema mani (edited October 24, 2001).]


Sun Certified Java Programmer<br />Sun Certified Web Component Developer<br />Sun Certified Business Component Developer
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Clearing DOS Window
 
Similar Threads
Clear DOS Screen in XP
Clearing DOS screen in Java
How to clear screen (clrscr) in java?
Clearing the Screen URGENT !!!!!
Clear DOS screen in XP