Matt Gerrans
Posts: 1153
Nickname: matt
Registered: Feb, 2002
|
|
Re: Clear MS-DOS screen
|
Posted: Jan 27, 2004 11:00 PM
|
|
mausam, if you are implying that you can simply do this:
Runtime.getRuntime().exec("cls");
then you surely have not tried it, or you'd know better. Even this:
Runtime.getRuntime().exec("cmd /c cls");
doesn't quite do the trick (and in any case, if you want to work on older versions of Windows, too, you should use %comspec%, but since it doesn't really work, the point is moot).
Pinky, if you had taken the trouble to search the forums for "clear screen" before posting your question, you'd see that it has been thoroughly covered: http://www.artima.com/forums/search.jsp?search=true&q=clear+screen&forums=-1&x=10&y=3.
In particular, the second hit shows how you would use JNI to do it: http://www.artima.com/forums/flat.jsp?forum=1&thread=293&message=684&redirect=true&hilite=true&q=clear+screen
|
|