Solved

ButtonGroup question..

Posted on 2002-04-15
3
280 Views
Last Modified: 2010-08-05
I have 5 x 5 radio button, the columns are in a button group, is it possible to have the columns in another button group where each button is a member of two groups?

ppl
A   1   2   3   4   5

B   1   2   3   4   5

C   1   2   3   4   5

D   1   2   3   4   5

E   1   2   3   4   5

In simple terms, no two rows (people A -> e) can have the same column value.
0
Comment
Question by:decob
3 Comments
 

Expert Comment

by:megloff
ID: 6943144
Hi
Are you using AWT? With AWT is this not possible, in this case you must implement listener and to code the behavior by yourself.
I think Swing is here more powerful. Have a look at java.swing.JRadiobutton and java.swing.ButtonGroup. You can add JButton's to the ButtonGroup. All JButtons in a ButtonGroup build an own Column. So theoretical, you can add a JButton to two different Groups, but I have never tried this.  

Hope this helps.

Regards
Mark

   
0
 
LVL 2

Accepted Solution

by:
mzimmer74 earned 100 total points
ID: 6943185
Well, I tried that, but if you put the same component in two different groups things don't work that well.  I made a 3x3 grid but clicking in any of the radio buttons caused any that was on to turn off even if it couldn't be in the same group.  So in short, the answer is no, you can't do it directly.  However, as with any component you could probably create your own special object that could handle this.  Not sure what it would be off the top of my head though.
0
 
LVL 92

Expert Comment

by:objects
ID: 6943395
Why not have 5 button groups, one for each column?
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
The viewer will learn how to implement Singleton Design Pattern in Java.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now