aspose file tools*
The moose likes Java in General and the fly likes About I/O Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "About I/O" Watch "About I/O" New topic
Author

About I/O

omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
How do we clear the monitor screen.....like we do in C or C++ prg using clrscr(); ?


Thanks and Regards
Omkar Patkar (SCJP 1.4)[url]http://javacollectionsnotes.blogspot.com[/url] | [url]http://omkar-myscjpexp.blogspot.com[/url]
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
There really isn't a pure Java equivalent to this. I find it rare that I need to do such a thing in much of my programming anyway. Why do you need to do this?

Layne


Java API Documentation
The Java Tutorial
omkar patkar
Ranch Hand

Joined: Aug 25, 2005
Posts: 231
Originally posted by Layne Lund:
There really isn't a pure Java equivalent to this. I find it rare that I need to do such a thing in much of my programming anyway. Why do you need to do this?

Layne


Simply!......just as i use to do in my C/C++ prgs....generally while working with prgs....i need the screen to be cleared which usually is cluttered with diffrent outputs....especially when i am testing my prg for diferent input values....thats why!
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
So you are saying that you need to do this for a visual clue that something new has happened? You can provide the same visual clue by inserting blank lines at appropriate places. A quick and dirty way to "clear the screen" is to just print out 60 blank lines in a row.

Layne
shank ram
Greenhorn

Joined: Sep 05, 2005
Posts: 22
Include this method in your code and call clrscr():

private static void clrscr() {
for (int i=0; i<=60; i++) {
System.out.println();
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: About I/O
 
Similar Threads
java platform independent?
Passing objects by reference or value???
user input values
SCAE - Question regarding consuming C++ applicaiton in Java
How to create a web services in c/c++