Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ButtonGroup multiple selection not possible.

843807Feb 19 2010 — edited Feb 26 2010
Hey Guys,

I have been trying to add a Buttongroup where i can select more than 1 JCheckBox. does anyone know how i can modify the code below so that i can select more than just one JCheckBox in the group?

ButtonGroup GroupPreferences = new ButtonGroup();

GroupPreferences.add(PreQ1);
GroupPreferences.add(PreQ2);
GroupPreferences.add(PreQ3);
GroupPreferences.add(PreQ4);
GroupPreferences.add(PreQ5);
GroupPreferences.add(PreQ6);
GroupPreferences.add(PreQ7);
GroupPreferences.add(PreQ8);
GroupPreferences.add(PreQ9);



if (PreQ1.isSelected()){

}

...etc.

Thank you

max
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2010
Added on Feb 19 2010
11 comments
679 views