How to add switches to a button group?

After dragging a button group in Netbeans 7.2, how do I add a switch to this button group?

+7
source share
4 answers

The switch property has a Button Group field. Set this value for each of the radio buttons that you want to add to the group to the name of the button group.

+15
source

Click the Button Group button, and then click anywhere in the project form. Select all the buttons you want to group by pressing CTRL and the button. Right-click on one of the buttons and select properties. In the ButtonGroup properties, click the down arrow. Your choice of button groups appears. Left-click on the desired.

+2
source

In Netbeans 8.0.1, I use:

 ButtonGroup bG = new ButtonGroup(); bG.add(btn_1); bG.add(btn_2); bG.add(btn_3); bG.add(btn_4); .... 
+2
source
  • Drag a ButtonGroup from the palette and place it in your GUI. It will appear in the Other Components section of the Inspector panel.
  • Right-click on it and change the variable name to something meaningful.
  • Now select the switch in the graphical interface.
  • In the Properties panel, find the buttonGroup property.
  • Click the combo box next to it and select a group of buttons.
0
source

All Articles