How to draw an arrow at the end of a line?????????????

Discussion in 'Java' started by steve smith, Jul 8, 2003.

  1. steve smith

    steve smith Guest

    Hi here is the probrlm i have, say i have two boxes drawn box1, and
    box2, and box1 is connected to box2, i want to be able to draw a line
    indicating the direction of the connection by means of an arrow. Is
    there any way this can be done? I have it working where the two boxes
    are connected by a line, but i could really do with an arro at the end
    of the line to ndicate direction, any help much appreciated thanks.
     
    steve smith, Jul 8, 2003
    #1
    1. Advertising

  2. steve smith

    pete kirkham Guest

    steve smith wrote:
    > Hi here is the probrlm i have, say i have two boxes drawn box1, and
    > box2, and box1 is connected to box2, i want to be able to draw a line
    > indicating the direction of the connection by means of an arrow. Is
    > there any way this can be done? I have it working where the two boxes
    > are connected by a line, but i could really do with an arro at the end
    > of the line to ndicate direction, any help much appreciated thanks.

    Work out the positions of a the vertices of a triangle (or other,
    prettier polygon) which you can use for an arrowhead, then use
    Graphics.fillPolygon(), Graphics.drawPolygon() or
    Graphics.drawPolyLine() to draw it. If the line is horizontal or
    vertical, this is trivial, otherwise it requires a little trig. and some
    tinkering with the values to allow for pixel boundaries.


    Pete
     
    pete kirkham, Jul 9, 2003
    #2
    1. Advertising

  3. steve smith

    Jim Sculley Guest

    steve smith wrote:
    > Hi here is the probrlm i have, say i have two boxes drawn box1, and
    > box2, and box1 is connected to box2, i want to be able to draw a line
    > indicating the direction of the connection by means of an arrow. Is
    > there any way this can be done? I have it working where the two boxes
    > are connected by a line, but i could really do with an arro at the end
    > of the line to ndicate direction, any help much appreciated thanks.


    You can find one example here:

    http://groups.google.com/groups?as_umsgid=<>&lr=&hl=en


    Jim S.

    --
    Remove my extraneous mandibular appendages to reply via e-mail.
     
    Jim Sculley, Jul 13, 2003
    #3
    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. M O J O
    Replies:
    1
    Views:
    376
  2. Knute Johnson

    Re: Draw a scaled arrow

    Knute Johnson, May 18, 2008, in forum: Java
    Replies:
    0
    Views:
    506
    Knute Johnson
    May 18, 2008
  3. Roedy Green

    Re: Draw a scaled arrow

    Roedy Green, May 19, 2008, in forum: Java
    Replies:
    3
    Views:
    542
    John B. Matthews
    May 21, 2008
  4. Andreas Leitgeb
    Replies:
    0
    Views:
    472
    Andreas Leitgeb
    May 15, 2009
  5. Replies:
    2
    Views:
    135
Loading...

Share This Page