java的swing单选框用法示例
- java语言
- 关注:2.76W次
本文实例讲述了java之swing单选框用法。具体如下:
import .*;import g.*;import t.*;public class test extends JAppletimplements ActionListener{ JTextField jtf; public void init(){ Container contentPane = getContentPane(); ayout(new FlowLayout()); JRadioButton b1 = new JRadioButton("A"); ctionListener(this); (b1); JRadioButton b2 = new JRadioButton("B"); ctionListener(this); (b2); JRadioButton b3 = new JRadioButton("C"); ctionListener(this); (b3); ButtonGroup bg = new ButtonGroup(); (b1); (b2); (b3); jtf = new JTextField(15); (jtf); } public void actionPerformed(ActionEvent ae){ ext(ctionCommand()); }}
- 文章版权属于文章作者所有,转载请注明 https://xuezhezhai.com/jsj/java/jwlrp.html