File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Question about Connecting Components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question about Connecting Components" Watch "Question about Connecting Components" New topic

Question about Connecting Components

Avin Sinanan

Joined: Nov 06, 2001
Posts: 7
Hello i have a very wierd situation.... here is what i would like to do..
Ok lets assume that i have 3 buttons and these 3 buttons are positioned within the same frame. Lets say these buttons can be dragged and dropped anywhere within the frame(ie they can be positioned anyhow).
Now lets say i want to connect button1 and button2 by drawing a line from button1 to button2. The line indicates that button1 and button2 are connected but button3 is not connected to neither button1 nor button2 because there is no line drawn from button3 to the other 2 buttons.
Hence the program should be able to connect components by drawing line between them.
The program should also allow to compoents not only to be connect but also interact. eg When button1 and button2 are connected , if we click button1 button2 will get a green border around it, but button3 will NOT get a green border around it becasue it is not connected to button1 and button2. ALso when 2 buttons are connected by a line then should both be hilighted by a yellow border or some color( i guess the color doesn't matter).
So can someone please help me with this.. i know its a bit wierd.. sorry if i cause you any stress.. thanks
Thanks for reading

Yours Respectfully<br />Avin Sinanan
Michael Ernest
High Plains Drifter

Joined: Oct 25, 2000
Posts: 7292

Hi avinsinanan -
There's a program that already does this; it's called the BeanBox, it's free, and it comes with source code. It's part of the Beans Development Kit which you can download from here.
Play with it; you'll see the functionality you're interested in, then you can look through the source to see how they did it. Happy hunting!
When you come back, could you please register with a first and last name? JavaRanch wants to maintain a professional looking site, and participants can help us do that by using their proper name as a login handle. Thanks!
Michael Ernest, co-author of: The Complete Java 2 Certification Study Guide

Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Sean MacLean
Ranch Hand

Joined: Nov 07, 2000
Posts: 621
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at . We require names to have at least two words, separated by a space, and strongly recommend that you use your full real name. Please log in with a new name which meets the requirements.
I agree. Here's the link:
subject: Question about Connecting Components
It's not a secret anymore!