File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes CLI based menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "CLI based menu" Watch "CLI based menu" New topic

CLI based menu

W Martin

Joined: Nov 12, 2003
Posts: 6
i've had to write a menu system for a college java project which has to be done thru the command line. That bit's fine, but i'm wondering is there any command available, or class that deals with, the clearing of the dos window. In other words when they type 'java Menu' for example, the screen clears and you're left with my output at the top of this blank dos window...
Elouise Kivineva
Ranch Hand

Joined: Feb 07, 2002
Posts: 154
You could achieve this by printing "\n" about 25 times.
rom chatterjee
Ranch Hand

Joined: Dec 11, 2001
Posts: 46
Silly question, but why do you want to do this? Personally, I like knowing what has gone before. If it is because of a style choice, then maybe you shouldnt (not everyone may agree with you).
However, if you wish to claer the screen for security reasons, why not have a native script that captures the secure information, clears the screen using the normal shell command, and calls your java program passing the secure information.
Hope this helps!

Rom Chatterjee<BR>Sun Certified Java Programmer
W Martin

Joined: Nov 12, 2003
Posts: 6
Well, in this college assignment we got it was specified that the menu system had to be text based, so the idea is to use a series of System.out.prinln() statements to output your choices and accept an integer from the keyboard, but to neaten it up i was hoping there was some way of issuing a DOS 'cls' command from within my java programme, or someway of removing the DOS prompt..for neatness sake
Thanks for the responses
I agree. Here's the link:
subject: CLI based menu
It's not a secret anymore!