Hello All,
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.
Chanchal
Jeff Higgins - 19 Jul 2007 13:02 GMT
> Hello All,
>
[quoted text clipped - 4 lines]
> Also i should be able to delete such lines drawn. KIndly advice
> Thanks in advance.
GeoSoft graciously provides a free, small, and in my opinion, very nice
graphics library that may do exactly what you want. If nothing else you
could study their source code.
I am not associated with GeoSoft.
<http://geosoft.no/graphics/index.html>
JH
Roedy Green - 19 Jul 2007 14:26 GMT
On Thu, 19 Jul 2007 01:28:20 -0700, Chanchal
<chanchal.jacob@gmail.com> 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.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com