Re: Moving an image
Max wrote:
I'm working on a project that involves moving a graphic,
A graphic what?
..and I am
expecting using a rectangle for it,
What 'rectangle'? Are you referring to a
java.awt.Rectangle? If so, note the capitalisation,
if not, please be more specific.
...but I can't figure out how to use
rectangle.inside, ...
If 'a)' above, and this was still Java 1.1 when
Rectangle.inside() was *not* deprecated, I
might care more on how to use it correctly.
...how to move the rectangle, or how to link the
rectangle and graphic. I STFW, but can't find anything that helps.
Could someone tell me a solution, ...
If you are trying to draw Image objects at
varying points on a Component, override
paint() (or paintComponent(), for Swing) and
use the Graphics object to drawImage() it
wherever the heck it needs to be at that
moment. For the task of moving it, you might
start a Thread to calculate the new position,
or do the same in a Timer.
That is assuming I have any idea what you
are talking about, and I'm not sure I do.
--
Andrew Thompson
http://www.athompson.info/andrew/
Message posted via http://www.javakb.com