您如何查看是否选择了按钮并将其用作二进制值
我有 3 个单选按钮,,,,b1
它们都是独立的(不在 a 中b2
),我需要当用户点击提交时,我可以将二进制值(如果按下则为 true,如果未按下则为 false)保存到变量中b3
ButtonGroup
//Gets details when submit is pressed
submit.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
String name = t.getText();
String surname = t1.getText();
String studentID = t2.getText();
//Code to place binary values into variables depending on the radio buttons selected
}
});