Results 1 to 2 of 2
- 05-08-2011, 01:08 AM #1
Member
- Join Date
- Nov 2010
- Posts
- 54
- Rep Power
- 0
How do I move an image after a certain time in Java?
I have a JPanel which i draw images in. I need to automatically move an images through the screen after about 1 second. Like move 50 pixels, stop for 1 second, move another 50 pixels. Or i wouldn't mind moving it all the way across the screen very slowly.
I tried just updating the position but it just moves the images rapidly. It is not show that it means. It just BAM moves.
How can i move across the jpanel slowly.
- 05-08-2011, 02:08 AM #2
- Join Date
- Jan 2011
- Location
- Richmond, Virginia
- Posts
- 3,069
- Blog Entries
- 3
- Rep Power
- 7
Consider looking at this tutorial on using a swing timer.
How to Use Swing Timers (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)
Similar Threads
-
how to move an image automatically without using mouse
By saranyabaskaran in forum New To JavaReplies: 6Last Post: 03-19-2011, 10:00 AM -
java gui that moves image based on time
By androidsm in forum New To JavaReplies: 10Last Post: 01-16-2011, 12:46 AM -
how to move this image
By melonka.sg in forum New To JavaReplies: 1Last Post: 01-08-2011, 04:53 PM -
To make image move
By mneskovic in forum New To JavaReplies: 4Last Post: 05-08-2010, 08:23 PM -
n00b : Ghost image while using mouseDragged event to move a filled jPanel
By ankitmcgill in forum New To JavaReplies: 5Last Post: 11-02-2008, 06:41 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks