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

S

steve smith

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.
 
P

pete kirkham

steve said:
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
 
J

Jim Sculley

steve said:
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=<[email protected]>&lr=&hl=en


Jim S.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top