Pradip Kharbuja
Pradip Kharbuja

Reputation: 3542

How to add radio buttons in button group?

After dragging and dropping button group in Netbeans 7.2, how to add radio button in that button group?

Upvotes: 13

Views: 47092

Answers (5)

zzfima
zzfima

Reputation: 1565

  1. Group it as suggested before
  2. Rebuild the Project
  3. After rebuild, you will see the common line:

enter image description here

Upvotes: 0

Akitha_MJ
Akitha_MJ

Reputation: 4304

  1. Drag a ButtonGroup from the palette and drop it on your GUI. It will show up under Other Components in the Inspector panel.
  2. Right-click on it and Change variable name to something meaningful.
  3. Now select a radio button in your GUI.
  4. In the Properties panel look for the buttonGroup property.
  5. Click the combo box next to it and select your button group.

Upvotes: 6

user3606336
user3606336

Reputation: 291

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);
    ....

Upvotes: 2

user4992816
user4992816

Reputation: 31

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.

Upvotes: 3

Bnrdo
Bnrdo

Reputation: 5474

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.

Upvotes: 25

Related Questions