Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Java and my moving star

  1. Jun 17, 2004 #1

    Nec

    User Avatar

    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
     
  2. jcsd
  3. Jun 17, 2004 #2

    robphy

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    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".
     
  4. Jun 17, 2004 #3

    Nec

    User Avatar

    Ah.., I see it now, thanks for your suggestions ..lol..
    (!ThumbsUp!)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Java and my moving star
  1. Java help (Replies: 15)

  2. Java q (Replies: 3)

  3. Java problem. (Replies: 4)

Loading...