主题:求高手解决同组单选框的值获取问题
final JRadioButton radioBtnMale = new JRadioButton();
radioBtnMale.setText("男");
radioBtnMale.setBounds(100, 220, 38, 26);
getContentPane().add(radioBtnMale);
final JRadioButton radioBtnFemale = new JRadioButton();
radioBtnFemale.setText("女");
radioBtnFemale.setBounds(232, 220, 45, 26);
getContentPane().add(radioBtnFemale);
bg=new ButtonGroup();
bg.add(radioBtnMale);
bg.add(radioBtnFemale);
我要获取客户选中的是什么性别 String sex=男or女
radioBtnMale.setText("男");
radioBtnMale.setBounds(100, 220, 38, 26);
getContentPane().add(radioBtnMale);
final JRadioButton radioBtnFemale = new JRadioButton();
radioBtnFemale.setText("女");
radioBtnFemale.setBounds(232, 220, 45, 26);
getContentPane().add(radioBtnFemale);
bg=new ButtonGroup();
bg.add(radioBtnMale);
bg.add(radioBtnFemale);
我要获取客户选中的是什么性别 String sex=男or女