posted 18 years ago
i would like to do this at the click of a button
This would be easy to control with booleans in paintComponent which are set in the listeners of your buttons.
I am also using opaque components
If you are using opaque (filled background) components then the technique shown in LinkedComponents above should work okay.
help me with regard to positioning the ends of the lines at the edge of the components
This is necessary for non–opaque (transparent/translucent background) components and primitives.