Hello,
I am new to java, and I need help with images. I am trying to move an image up the screen while still allowing another image to move using the arrow keys. If I use
`thread.sleep` to move the image, I cant move my other image at the same time. Does anybody have a solution? I am on Mac OSX Lion, if that helps. My code is attached.
agwx2
0
Newbie Poster
Recommended Answers
Jump to PostHave 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.
Jump to PostNo 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.
All 5 Replies
NormR1
563
Posting Sage
Team Colleague
agwx2
0
Newbie Poster
NormR1
563
Posting Sage
Team Colleague
agwx2
0
Newbie Poster
agwx2
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.