Solved

ButtonGroup question..

Posted on 2002-04-15
3
281 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to execute a Python program and gather return output in Java 2 41
sql import cannot be resolved jsp 3 49
hashmap order 17 37
jsp error 6 26
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:

820 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