Re: Drawing line from one JButton to another JButton



On Thu, 19 Jul 2007 01:28:20 -0700, Chanchal
<chanchal.jacob@xxxxxxxxx> wrote, quoted or indirectly quoted someone
who said :

I'm developing some thing like an electronic circuit designer. I have
a number of JButtons placed programatically on a JPanel. Now I need to
draw lines between pairs of JButtons by dragging mouse from one button
to another one. Please advice on how such a thing can be implemented.
Also i should be able to delete such lines drawn. KIndly advice
Thanks in advance.

See http://mindprod.com/jgloss/pane.html

The trick might be to draw the lines on a different pane. You let the
layout manager place the buttons, then you ask the buttons where they
are with getLocation.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.