Solved

ButtonGroup question..

Posted on 2002-04-15
3
284 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

628 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