• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Question about Connecting Components

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
author
Posts: 621
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"avinsinanan",
The Java Ranch has thousands of visitors every week, many with surprisingly similar names. To avoid confusion we have a naming convention, described at http://www.javaranch.com/name.jsp . 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.
Thanks.
Sean
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic