标签:def extends 单选按钮 size getc 组件 method ant button
public class asd extends JFrame{ public asd() { // TODO Auto-generated constructor stub Container c = getContentPane(); setLayout(new GridLayout(2,2,5,5)); JRadioButton jr1 = new JRadioButton("男"); JRadioButton jr2 = new JRadioButton("女"); ButtonGroup group = new ButtonGroup(); group.add(jr1); group.add(jr2); c.add(jr1); c.add(jr2); setSize(300,300); setVisible(true); setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } public static void main(String[] args) { // TODO Auto-generated method stub new asd(); } }
标签:def extends 单选按钮 size getc 组件 method ant button
原文地址:https://www.cnblogs.com/dulute/p/10583390.html