Results 1 to 2 of 2
- 02-20-2010, 09:46 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 6
- Rep Power
- 0
How to apply system cls in java...
I want to use clear screen in my program bcoz it's look very messy
but i don't know how.
I try googling but its difficult to undrstand the tutorials..
anybody?
Java Code:public static void main(String[] args) { Scanner myOpt=new Scanner(System.in); Books b1= new Books(); int optB=0; int updateOpt=0,x=0; do{ System.out.println("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^"); System.out.println("WELCOME TO CyZAH && NADyA BOOKSTORES"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("-1- Initialize BOOK's details"); System.out.println("-2- Key in BOOK's details"); System.out.println("-3- Update BOOK's details"); System.out.println("-4- Display BOOK's details"); System.out.println("-5- Finish BOOK's tasks"); System.out.println("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"); System.out.println("==>Please choose your option:"); optB=myOpt.nextInt(); switch(optB){ case 1: b1.intBooks();break; case 2: b1.enterBooks(); System.out.println("Input completed!"); System.out.println("###################");break; case 3: b1.displayBookItem(); System.out.println("Please enter your option:"); updateOpt=myOpt.nextInt(); b1.updateBook(updateOpt); System.out.println("Update completed"); break; case 4: b1.displayBook();break; case 5: System.out.println("EXIT");break; default:System.out.println("Please try again "); } }while(optB!=5); }Last edited by cyzash; 02-20-2010 at 09:47 AM. Reason: code tag
- 02-20-2010, 11:50 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,375
- Blog Entries
- 7
- Rep Power
- 17
The 'cls' command is built-in in your cmd.exe (shell or command processor), so it isn't available as a separate executable program. Lucky enough, you can pass it as a parameter to cmd.exe: "cmd /c cls" and cmd.exe is an executable program. You can 'exec' it; read the API documentation for the Runtime class for details.
kind regards,
Jos
Similar Threads
-
How to apply a patch (Call Matlab from Java)
By Niroshan in forum Advanced JavaReplies: 6Last Post: 07-09-2011, 02:55 AM -
Java GUI app used to apply XSLT to XML's
By fawkes711 in forum XMLReplies: 1Last Post: 12-09-2009, 08:59 AM -
how to apply gravity in tossing an egg
By santhoshnanjappa in forum New To JavaReplies: 1Last Post: 07-01-2009, 02:26 PM -
Kindly Help me to apply Stylesheet
By AMATYA-CHANAKYA in forum Advanced JavaReplies: 0Last Post: 03-18-2008, 06:30 AM -
ERROR: Java(TM) failes to apply changes to your system
By coco in forum New To JavaReplies: 1Last Post: 08-07-2007, 07:40 AM


LinkBack URL
About LinkBacks


Bookmarks