Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 How to Clear screen?
Index -> Programming, Java -> Java Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jacklarry




PostPosted: Tue Oct 16, 2007 4:58 pm   Post subject: How to Clear screen?

hey,
I am having difficulty learning to clear the screen. Can anyone please help me? I have a main menu that asks for grocery items like whether they wanna buy it or return it, and then once they choice is picked, i want the main menu to be cleared away so that i can continue with the process. Can anyone please tell me wut the line for clearing the screen is for VB. Thank a lot once again. Oh, and can you tell me the code to close the window and exit the program....like if the choose to exit, then wut line shud i put...but plz help me with clearing the screen first. Thanks a million.
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Oct 16, 2007 5:43 pm   Post subject: RE:How to Clear screen?

Eh.. so is this for VB (what version?) or Java?

It would probably help to know how you're drawing to screen in the first place.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
HeavenAgain




PostPosted: Tue Oct 16, 2007 6:30 pm   Post subject: RE:How to Clear screen?

i tried answering 3 times, but the more i look at what you need, the more i got lost Crying or Very sad VB or Java, and what window?
jacklarry




PostPosted: Wed Oct 17, 2007 1:10 pm   Post subject: RE:How to Clear screen?

i am extremely sorry...i am talking about java not VB
Euphoracle




PostPosted: Wed Oct 17, 2007 2:12 pm   Post subject: RE:How to Clear screen?

Are you referring to the screen as in drawing shapes, SWING, awt, etc. or to the console?
jacklarry




PostPosted: Wed Oct 17, 2007 7:10 pm   Post subject: RE:How to Clear screen?

no just writing...simple code..simply writing
Euphoracle




PostPosted: Wed Oct 17, 2007 7:30 pm   Post subject: RE:How to Clear screen?

So the console then. Java isn't well known for giving the programmer access to the console. I'm not sure if this will work, but you can call the ANSI sequence:

System.out.print( ( ( char ) 27 ) + "[2J" );

Test it, see what happens. Also, you could try System.out.flush(); but I haven't the slightest idea if that'll work or not.
OneOffDriveByPoster




PostPosted: Wed Oct 17, 2007 9:59 pm   Post subject: Re: How to Clear screen?

Could also try (for *nix)
Java:
System.out.print("\f");
Sponsor
Sponsor
Sponsor
sponsor
HeavenAgain




PostPosted: Wed Oct 17, 2007 10:10 pm   Post subject: RE:How to Clear screen?

if im not wrong, that will just print an empty line? "\f"? but thats a good way i guess, since there is no other way to clear the interaction just by coding? if thats the case, then just use System.out.println();
Shiro786




PostPosted: Thu Oct 18, 2007 1:33 pm   Post subject: Re: How to Clear screen?

System.out.clear();

I'm pretty sure that
wtd




PostPosted: Thu Oct 18, 2007 3:42 pm   Post subject: RE:How to Clear screen?

The correct answer to "how do you clear the default text console?" is...

Don't
Display posts from previous:   
   Index -> Programming, Java -> Java Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: