Results 1 to 4 of 4
  1. #1
    Crakrjack is offline Member
    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0

    Default A question regarding Graphics.setClip

    I am attempting to draw a line between the centers of rectangles and I need the line to stop at the edge of the rectangle. My clipping area is essentially a rectangle with smaller rectangles cut from 2 diagonally opposite corners. Could someone please advise how I would go about creating this shape so that i can pass it to the .setClip method?

    Thanks.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: A question regarding Graphics.setClip

    Start by making a drawing on paper to see where the corners are for the shape you need.
    Look at the Shape interface to see what classes could be useful to represent that shape.
    If you don't understand my response, don't ignore it, ask a question.

  3. #3
    Crakrjack is offline Member
    Join Date
    Sep 2013
    Posts
    20
    Rep Power
    0

    Default Re: A question regarding Graphics.setClip

    Cheers Norm,

    It's all working now using a Polygon.

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default Re: A question regarding Graphics.setClip

    Glad you got it working.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. Question about Graphics in Swing
    By MW130 in forum New To Java
    Replies: 15
    Last Post: 01-15-2013, 05:21 AM
  2. Graphics.drawImage() question
    By sakratt in forum AWT / Swing
    Replies: 0
    Last Post: 03-28-2012, 10:52 PM
  3. Graphics question
    By Guy in forum New To Java
    Replies: 6
    Last Post: 07-19-2011, 07:23 AM
  4. Question on Graphics etc...
    By loopsnhoops in forum Advanced Java
    Replies: 2
    Last Post: 02-10-2011, 11:10 PM
  5. java graphics question
    By bobCallahan24 in forum AWT / Swing
    Replies: 1
    Last Post: 01-15-2010, 06:04 AM

Posting Permissions

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