dcsimg
Mouse-sensitive graphic lines
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Michael_Redulla
Posted On:   Friday, July 6, 2001 12:59 AM

I am writing a drawing tool (a JDK 1.1 applet) that basically allows a user to draw a flowchart- like diagram. The user can add buttons to a panel and position them on specific coordinates. A line can be drawn between two buttons by pressing the mouse on the first button, dragging the mouse and releasing it over the second button. It can easily be done through Graphics.drawLine(). However, I want the line to accept mouse events and stretch or shorten when one of the buttons is moved. I initially thought of implementing the line as a component. I've read about non-rectangular and transparent lightweight components. Howe   More>>

I am writing a drawing tool (a JDK 1.1 applet)
that basically allows a user to draw a flowchart-
like diagram. The user can add buttons to a panel
and position them on specific coordinates.



A line can be drawn between two buttons by pressing
the mouse on the first button, dragging the mouse
and releasing it over the second button.



It can easily be done through Graphics.drawLine().
However, I want the line to accept mouse events
and stretch or shorten when one of the buttons is
moved.



I initially thought of implementing the line as
a component. I've read about non-rectangular and
transparent lightweight components. However, I don't
know how to really implement it.

Please help. It would be good to see examples.
I am limited to using JDK 1.1.

   <<Less
About | Sitemap | Contact