/**
* @ClassName: GUiMain
* @Description: GUI主窗口文件
* @Author: CHK141
* @Date: 2020/11/26/0026 22:02
* @Mail: [email protected]
* @Version: 1.0
*/
public class GUiMain {
public static void main(String[] args) {
JFrame window = new JFrame();
// 窗口大小及初始坐标
window.setSize(700, 550);
// 是否显示
window.setVisible(true);
// 窗口标题
window.setTitle("皇宫QQ计数器");
// 窗口居中显示
window.setLocationRelativeTo(null);
// 彻底关闭
window.setDefaultCloseOperation(window.EXIT_ON_CLOSE);
// 禁止拖动
window.setResizable(false);
// 清空窗口布局
window.getContentPane().setLayout(null);
// 添加一个按钮
JButton button = new JButton("按钮");
button.setBounds(10, 10, 100, 40);
window.add(button);
// 添加一个标签
JLabel label = new JLabel("测试标签");
label.setBounds(40, 40, 100, 40);
window.add(label);
// 添加一个多选框
JCheckBox checkBox = new JCheckBox("测试多选框");
checkBox.setBounds(80, 30, 100, 40);
window.add(checkBox);
}
}