2
Contributors
5
Replies
7
Views
5 Years
Discussion Span
Last Post by agwx2
0

Have you looked at using a Timer? The listener method can change the image's x,y location and call repaint() which will cause the paintComponent() method to be called where the drawImage() method can draw the image at the new x,y location.

0

But i need the second image to be animated, moving up, while i can still move the first image with the arrow keys.

0

No problem. You can move many images at the same time. Each image would have its own x,y locations and its own control code that changed its x,y values.

0

What do you mean by control mode?

BTW Could you please post sample code, because i am new to java and i still dont understand (sorry.)

0

Don't mind my previous post. I just solved the problem using a timer! Thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.