This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
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
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
"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