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
.



Relevant Pages

  • Re: Help Wanted! for Unruly 3yo & more
    ... I appreciate all the great advice I don't ... all draw chores and do them as fast as we can do them well! ... Since Chloe can't really do a whole chore ... she won't go to sleep) and has never taken a nap. ...
    (misc.kids)
  • Re: Drawing line from one JButton to another JButton
    ... I'm developing some thing like an electronic circuit designer. ... a number of JButtons placed programatically on a JPanel. ... draw lines between pairs of JButtons by dragging mouse from one button ... Please advice on how such a thing can be implemented. ...
    (comp.lang.java.gui)
  • Re: Advice on rustication
    ... I just want it to enhance my staff carving a bit. ... You asked for advice, here is advice worth every penny it cost. ... Do not draw or make a pattern and then follow it. ...
    (alt.smokers.pipes)
  • Re: stud 8/b
    ... > while i think your post was much more helpful i think that my advice works ... about how situations change the correct play. ... Never draw to to the high? ... > i'm pretty decent at repeating the advice i was given when asking the same ...
    (rec.gambling.poker)
  • Drawing line from one JButton to another JButton
    ... I'm developing some thing like an electronic circuit designer. ... a number of JButtons placed programatically on a JPanel. ... draw lines between pairs of JButtons by dragging mouse from one button ... Please advice on how such a thing can be implemented. ...
    (comp.lang.java.gui)