当前位置:学者斋 >

计算机 >java语言 >

java的swing单选框用法示例

java的swing单选框用法示例

本文实例讲述了java之swing单选框用法。具体如下:

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