GUI 之多选按钮
作者:互联网
编写代码 JButtonDemo03测试类
package com.xiang.lesson05;
import javax.swing.*;
import java.awt.*;
public class JButtonDemo03 extends JFrame {
public JButtonDemo03() {
Container container = getContentPane();
//多选框
JCheckBox jCheckBox01 = new JCheckBox("JCheckBox01");
JCheckBox jCheckBox02 = new JCheckBox("JCheckBox02");
container.add(jCheckBox01,BorderLayout.WEST);
container.add(jCheckBox02,BorderLayout.EAST);
setVisible(true);
setBounds(100, 100, 300, 200);
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new JButtonDemo03();
}
}
运行结果
标签:JCheckBox,container,GUI,public,add,按钮,new,之多选,JButtonDemo03 来源: https://www.cnblogs.com/d534/p/15111695.html