PDA

View Full Version : Java and my moving star


Nec
Jun17-04, 09:17 PM
In my JFrame, I already draw a 2d star, i would like to make it move around in my frame, but i don't know how to erase the old star when it appears in a new position, can anyone here help me with this ?
Thanks

robphy
Jun17-04, 10:13 PM
Although I haven't done much Java programming recently, I think one of the following suggestions could be used.

1. Before updating the position of the star, you could first paint it the background color.

2. Alternatively, you could implement "double buffering".

Nec
Jun17-04, 10:21 PM
Ah.., I see it now, thanks for your suggestions ..lol..
(!ThumbsUp!)