摘要: JLabel label = new JLabel("宽度:400,高度:300");// 创建标签控件 contentPane.add(label, BorderLayout.CENTER);// 添加标签控件到窗体 阅读全文
posted @ 2023-01-15 22:01 cnetsa 阅读(41) 评论(0) 推荐(0)
摘要: setContentPane(contentPane);// 设置内容面板 阅读全文
posted @ 2023-01-15 22:00 cnetsa 阅读(18) 评论(0) 推荐(0)
摘要: contentPane.setLayout(new BorderLayout(0, 0));上面三个构造器的hgap、vgap代表水平间距、垂直间距,为这两个参数传入整数值即可 阅读全文
posted @ 2023-01-15 21:57 cnetsa 阅读(173) 评论(0) 推荐(0)
摘要: contentPane = new JPanel();// 创建内容面板 阅读全文
posted @ 2023-01-15 21:56 cnetsa 阅读(20) 评论(0) 推荐(0)
摘要: setSize(400, 300);// 设置窗体大小 阅读全文
posted @ 2023-01-15 21:56 cnetsa 阅读(47) 评论(0) 推荐(0)
摘要: setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);// 默认关闭方式 阅读全文
posted @ 2023-01-15 21:56 cnetsa 阅读(34) 评论(0) 推荐(0)
摘要: setTitle("设置窗体大小");// 设置窗体标题 阅读全文
posted @ 2023-01-15 21:55 cnetsa 阅读(94) 评论(0) 推荐(0)
摘要: getDeclaredMethods自定义方法 protected void do_this_componentMoved(ComponentEvent e) { Point location = getLocation();// 获取窗体坐标 int x = location.x; int y = 阅读全文
posted @ 2023-01-15 20:37 cnetsa 阅读(79) 评论(0) 推荐(0)
摘要: 类型的父类 阅读全文
posted @ 2023-01-15 20:36 cnetsa 阅读(9) 评论(0) 推荐(0)
摘要: Modifier修饰符 阅读全文
posted @ 2023-01-15 20:35 cnetsa 阅读(21) 评论(0) 推荐(0)