File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Clearing DOS Window

 
seema mani
Ranch Hand
Posts: 49
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic