| Author |
Information about moving shapes
|
Hugh Thompson
Greenhorn
Joined: Apr 18, 2010
Posts: 1
|
|
Hello,
I have a project in which I feel it would be useful to have some form of animation. Not something too complicated, but a stick figure maybe made up of lines and a circle . I have data that I will be reading from files, and was hoping to be able to use this data to make the stick figure "move" in some simple way.
I've been looking and trying code related to shapes, and I know it is possible to specify the coordinates of a shape. But what if I want that shape to move in real time? So while I am reading coordinate data from a file, for example, a circle in my interface will move based on the information in the file. The user will see the circle moving while the code is running. Is this feasible at all?? How could it be implemented?
Many thanks,
Hugh
|
 |
Rob Spoor
Sheriff
Joined: Oct 27, 2005
Posts: 19232
|
|
|
Use a javax.swing.Timer to call repaint() on the component on which you draw the image.
|
SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
|
 |
 |
|
|
subject: Information about moving shapes
|
|
|