Results 1 to 9 of 9
  1. #1
    zhider is offline Member
    Join Date
    Oct 2012
    Posts
    37
    Rep Power
    0

    Default Growing rectangle, very easy answer I am sure.

    When you have a rectangle with coordinates say... (1, 1, 3, 2) and grow the rectangle using box1.grow (1, 1), would all 4 points increase by 1, or just the width and height (2, 2, 4, 3) or (1, 1, 4, 3)?

    Thanks in advance guys.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Growing rectangle, very easy answer I am sure.

    What API is this? Because it's not part of standard core Java.

  3. #3
    zhider is offline Member
    Join Date
    Oct 2012
    Posts
    37
    Rep Power
    0

    Default Re: Growing rectangle, very easy answer I am sure.

    Im using the Netbeans IDE.

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,755
    Rep Power
    19

    Default Re: Growing rectangle, very easy answer I am sure.

    That's an IDE, not an API.
    What framework/classes/API is this?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    zhider is offline Member
    Join Date
    Oct 2012
    Posts
    37
    Rep Power
    0

    Default Re: Growing rectangle, very easy answer I am sure.

    How do you tell? I'm very new to Java, sorry

  6. #6
    zhider is offline Member
    Join Date
    Oct 2012
    Posts
    37
    Rep Power
    0

    Default Re: Growing rectangle, very easy answer I am sure.

    It is in AWT

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Growing rectangle, very easy answer I am sure.

    OK, thanks. The Rectangle API will tell you exactly what the grow(...) method does: Rectangle#grow(int h, int v). Looks like it expands in all directions.

    Oh, and I take back the part of this not being part of standard Java. I've just never seen the grow(...) method before.

  8. #8
    zhider is offline Member
    Join Date
    Oct 2012
    Posts
    37
    Rep Power
    0

    Default Re: Growing rectangle, very easy answer I am sure.

    Alright, thanks!

  9. #9
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Growing rectangle, very easy answer I am sure.

    You're welcome!

Similar Threads

  1. Replies: 3
    Last Post: 03-19-2012, 05:20 AM
  2. polygon growing
    By ericT in forum New To Java
    Replies: 1
    Last Post: 09-24-2011, 08:35 PM
  3. Compare true Answer /Player answer
    By Eilime in forum New To Java
    Replies: 1
    Last Post: 04-24-2011, 08:51 PM
  4. Wrong with Rectangle res = new Rectangle(0,0,0,0);???
    By jiapei100 in forum AWT / Swing
    Replies: 3
    Last Post: 09-25-2010, 03:39 PM
  5. Reading growing files
    By ionna22 in forum Advanced Java
    Replies: 0
    Last Post: 10-20-2008, 04:43 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •