Moving an image

Discussion in 'Java' started by Max, Jul 20, 2007.

  1. Max

    Max Guest

    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!
     
    Max, Jul 20, 2007
    #1
    1. Advertising

  2. 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
     
    Andrew Thompson, Jul 20, 2007
    #2
    1. Advertising

  3. Max

    Max Guest

    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.
     
    Max, Jul 20, 2007
    #3
  4. 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
     
    Andrew Thompson, Jul 20, 2007
    #4
  5. Max

    Oliver Wong Guest

    "Max" <> wrote in message
    news:...
    >
    > 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
     
    Oliver Wong, Jul 24, 2007
    #5
  6. Max

    Lew Guest

    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
     
    Lew, Jul 25, 2007
    #6
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Marc

    Image magically moving

    Marc, Sep 23, 2003, in forum: HTML
    Replies:
    5
    Views:
    371
  2. linkswanted
    Replies:
    0
    Views:
    1,208
    linkswanted
    Dec 21, 2007
  3. linkswanted
    Replies:
    0
    Views:
    1,583
    linkswanted
    Jan 6, 2008
  4. linkswanted
    Replies:
    0
    Views:
    457
    linkswanted
    Jan 23, 2008
  5. linkswanted
    Replies:
    0
    Views:
    643
    linkswanted
    Jan 24, 2008
Loading...

Share This Page