Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Moving an image

Reply
Thread Tools

Moving an image

 
 
Max
Guest
Posts: n/a
 
      07-20-2007
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!

 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      07-20-2007
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

 
Reply With Quote
 
 
 
 
Max
Guest
Posts: n/a
 
      07-20-2007
On Jul 20, 11:49 am, "Andrew Thompson" <u32984@uwe> wrote:
> 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.

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      07-20-2007
Max wrote:
...
>> 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.

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

Message posted via http://www.javakb.com

 
Reply With Quote
 
Oliver Wong
Guest
Posts: n/a
 
      07-24-2007
"Max" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ps.com...
>
> 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


 
Reply With Quote
 
Lew
Guest
Posts: n/a
 
      07-25-2007
Oliver Wong wrote:
> 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.

--
Lew
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Moving Guide Moving Companies Movers Storage linkswanted ASP .Net 0 01-23-2008 01:08 AM
Free Moving Estimate, Local Movers, Long Distance Moving, PackingSupplies, Storage Rental, Home Moving, Apartment Moving, Office Moving,Commercial Moving linkswanted ASP .Net 0 01-06-2008 04:45 AM
Moving to California Moving to L.A linkswanted Digital Photography 3 01-05-2008 04:22 PM
movers los angeles moving storage services movers in L.A companymoving companies moving in calfornia los angeles linkswanted HTML 0 12-21-2007 10:55 PM



Advertisments