aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Information about moving shapes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Information about moving shapes" Watch "Information about moving shapes" New topic
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: 19543
    
  16

Use a javax.swing.Timer to call repaint() on the component on which you draw the image.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Information about moving shapes
 
Similar Threads
Can't find my error
Abstract class quandary
Casting a extended class
Help with Model View Control concept
Calling methods using dynamic binding