Computer Science Canada Cear screen |
Author: | xX_MayDay_Xx [ Fri May 05, 2006 8:08 am ] |
Post subject: | Cear screen |
ok i am attempting to make a game of chess in java, i am just in the beginning stages of it and i was wonedring if there was anyway to clear the screen........like in Turing you put "cls" to clear....what is it in java? |
Author: | codemage [ Fri May 05, 2006 8:40 am ] |
Post subject: | |
clear(); |
Author: | cool dude [ Fri May 05, 2006 5:33 pm ] |
Post subject: | |
r u sure thats the command because it doesn't work for me. i get an error saying cannot resolve symbol - method clear() |
Author: | wtd [ Fri May 05, 2006 5:36 pm ] |
Post subject: | |
In what context did you call it? I suspect this is a method in some HSA specific class. |
Author: | cool dude [ Fri May 05, 2006 6:36 pm ] |
Post subject: | |
wtd wrote: In what context did you call it?
I suspect this is a method in some HSA specific class. not sure. how am i supposed to call it? |
Author: | wtd [ Fri May 05, 2006 6:39 pm ] |
Post subject: | |
I'm not familiar with the Holt classes. |
Author: | [Gandalf] [ Fri May 05, 2006 11:53 pm ] |
Post subject: | |
If you are not using the HSA classes, you have three options that I know of: 1. Fill the screen with a large filled in box of your background colour. 2. Just repaint() the applet (or whatever it is you're using), this will call the update() method which clears the screen for you. 3. If you are using double buffering you just free the previous frame's image and redraw the new one. |