Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / July 2007

Tip: Looking for answers? Try searching our database.

Drawing line from one JButton to another JButton

Thread view: 
Chanchal - 19 Jul 2007 09:28 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.