Moving an image

M

Max

I'm working on a project that involves moving a graphic, and I am
expecting using a rectangle for it, but I can't figure out how to use
rectangle.inside, 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, site, or search term? Thanks!
 
A

Andrew Thompson

Max said:
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.
 
M

Max

A graphic what? JPEG file, using MediaTracker.

Are you referring to a java.awt.Rectangle? If so, note the capitalisation, Done.

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.
Is it Java 1.1 THAT old? Eek... that IS what I'm using.
 
A

Andrew Thompson

Max wrote:
...
To clarify, that comment simply meant that I noticed
the JavaDocs stated it was deprecated in Java 1.2.
Is it Java 1.1 ...

Many of the most useful methods were introduced
in Java 1.1 - all those methods (including the deprecated
ones) are still in Java 1.6.
..THAT old? Eek... that IS what I'm using.

Ehh..? I've written codes compatible with Java 1.6
that used many 1.1 methods in the last couple of days.
Generally you would go for Swing in this day and age,
rather than AWT (components - still use the AWT
layouts, events, ..) introduced in 1.2 - for the GUI.
 
O

Oliver Wong

Max said:
Is it Java 1.1 THAT old? Eek... that IS what I'm using.

1.1 is freaking old. It's from 1997; 10 years ago. If you have a
choice, upgrade. Preferably to 1.6, which is already almost 1 year old,
and 1.7 should be coming out soon, sometime in 2008.

The releases come out about once ever 2 years. I think Sun doesn't
even bother supporting anything lower than 1.4 anymore (and will probably
drop 1.4 when 1.7 comes out).

- Oliver
 
L

Lew

Oliver said:
The releases come out about once ever 2 years. I think Sun doesn't
even bother supporting anything lower than 1.4 anymore (and will probably
drop 1.4 when 1.7 comes out).

That is correct. Sun officially dropped support for 1.3 when 6 came out.

They had already announced commencement of the "End-of-Life" (EOL) process for
1.4.2, but they don't seem to have that notice up any more. Still, they do
say in their EOL policy,
Major Product Family Releases

This would include such products as Java 2 Platform, Standard Edition 1.4.2 and 5.0. The Java technology policy is to support the current shipping version of Java Standard Edition plus two back versions.

That implies that 1.4.x will go into EOL when Java 7 comes out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top