在Netbeans 7.2中拖放按钮组之后,如何在该按钮组中添加单选按钮?
There's a Button Group
field in the radio button's property. Set this value for each of the radio button that you want to add in the group to the button group's name.
Click on the Button Group and then click anywhere in the design 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 of the Properties, click on the down arrow. Your selection of button groups should appear. Left click on the one you want.
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);
....
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.