
-----------------------------------
jacklarry
Tue Oct 16, 2007 4:58 pm

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.

-----------------------------------
Tony
Tue Oct 16, 2007 5:43 pm

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.

-----------------------------------
HeavenAgain
Tue Oct 16, 2007 6:30 pm

RE:How to Clear screen?
-----------------------------------
i tried answering 3 times, but the more i look at what you need, the more i got lost :cry: VB or Java, and what window?

-----------------------------------
jacklarry
Wed Oct 17, 2007 1:10 pm

RE:How to Clear screen?
-----------------------------------
i am extremely sorry...i am talking about java not VB

-----------------------------------
Euphoracle
Wed Oct 17, 2007 2:12 pm

RE:How to Clear screen?
-----------------------------------
Are you referring to the screen as in drawing shapes, SWING, awt, etc. or to the console?

-----------------------------------
jacklarry
Wed Oct 17, 2007 7:10 pm

RE:How to Clear screen?
-----------------------------------
no just writing...simple code..simply writing

-----------------------------------
Euphoracle
Wed Oct 17, 2007 7:30 pm

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
Wed Oct 17, 2007 9:59 pm

Re: How to Clear screen?
-----------------------------------
Could also try (for *nix)
System.out.print("\f");

-----------------------------------
HeavenAgain
Wed Oct 17, 2007 10:10 pm

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
Thu Oct 18, 2007 1:33 pm

Re: How to Clear screen?
-----------------------------------
System.out.clear();

I'm pretty sure that

-----------------------------------
wtd
Thu Oct 18, 2007 3:42 pm

RE:How to Clear screen?
-----------------------------------
The correct answer to "how do you clear the default text console?" is...

Don't
