Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

ButtonGroup question..

Posted on 2002-04-15
3
Medium Priority
?
289 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 300 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

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Suggested Courses

877 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