I have checkboxes. I have a buttongroup. When I click on the option “All Checkboxes,” I want all checkboxes in the button group to be made unselectable (grayed out) (Except the “All Checkboxes” one which is selected.) How do I this?
Also, how can I add an item/set the items to a Combo Box using NetBeans?
A ButtonGroup cannot be used to grey-out (functionally and visibly disable) a JCheckBox. Better to put them in a
List<JCheckBox>and in the ActionListener for “All CheckBoxes” iterate through callingsetEnabled(true/false)on the items in the list, the parameter depending on the state of the “All Checkboxes” JCheckBox.I have no idea how to do this “using NetBeans”, but using Swing you simply get the JComboBox’s model, usually a DefaultComboBoxModel, and add items to it.