Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / July 2007

Tip: Looking for answers? Try searching our database.

Moving an image

Thread view: 
Max - 20 Jul 2007 16:24 GMT
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!
Andrew Thompson - 20 Jul 2007 16:49 GMT
>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.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Max - 20 Jul 2007 17:28 GMT
> 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.
Andrew Thompson - 20 Jul 2007 17:37 GMT
...
>> 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.

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.

Signature

Andrew Thompson
http://www.athompson.info/andrew/

Oliver Wong - 24 Jul 2007 19:11 GMT
> 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
Lew - 25 Jul 2007 03:39 GMT
>     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,
<http://java.sun.com/products/archive/eol.policy.html>
> 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.

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.