Radio button in java
How to use radio button in java.?
JRadioButton male = new JRadioButton("male");
JRadioButton female = new JRadioButton("Female");
panel.add(male);
panel.add(female);
but here the problem is both of themm also can be able to use...normally in radi button cannot be multiple choice rite
so how?
[335 byte] By [
Ratza] at [2007-10-3 10:23:27]

> How to use radio button in java.?
>
> JRadioButton male = new JRadioButton("male");
> JRadioButton female = new JRadioButton("Female");
>
> panel.add(male);
> panel.add(female);
> but here the problem is both of themm also can be
> able to use...normally in radi button cannot be
> multiple choice rite
>
> so how?
JRadioButton male = new JRadioButton("male");
JRadioButton female = new JRadioButton("Female");
ButtonGroup group = new ButtonGroup();
group.add(male);
group.add(female);