当前位置:网站首页>GUI窗口
GUI窗口
2022-07-25 09:27:00 【看小虫子】
布局管理器作业
package Awt;
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
public class HoneWork {
public static void main(String[] args) {
Frame frame=new Frame("title");
frame.setLayout(new GridLayout(2,1));
frame.setBounds(100,200,200,200);
frame.setVisible(true);
//frame.show();
Panel panel1=new Panel(new BorderLayout());
Panel panel2=new Panel(new GridLayout(2,1));
Panel panel3=new Panel(new BorderLayout());
Panel panel4=new Panel(new GridLayout(2,2));
frame.add(panel1);
Button btn1=new Button("btn1");
Button btn2=new Button("btn2");
panel2.add(new Button("p2-btn-1"));
panel2.add(new Button("p2-btn-2"));
panel1.add(btn1,BorderLayout.WEST);
panel1.add(btn2,BorderLayout.EAST);
panel1.add(panel2,BorderLayout.CENTER);
panel3.add(new Button("btn"),BorderLayout.WEST);
panel3.add(new Button("btn"),BorderLayout.EAST);
panel4.add(new Button("btn"));
panel4.add(new Button("btn"));
panel4.add(new Button("btn"));
panel4.add(new Button("btn"));
panel3.add(panel4);
frame.add(panel3);
//关闭窗口
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}
边栏推荐
- Internal structure of SOC chip
- CCF 201509-4 Expressway
- UE4 外部打开exe文件
- Es6详解
- Filter filter details (listeners and their applications)
- cookie and session
- vant问题记录
- nodejs链接mysql报错:ER_NOT_SUPPORTED_AUTH_MODEError: ER_NOT_SUPPORTED_AUTH_MODE
- 四舍五入取近似值
- [recommended collection] with these learning methods, I joined the world's top 500 - the "fantastic skills and extravagance" in the Internet age
猜你喜欢

CCF 201509-3 template generation system

Configuring ROS development environment with vscode: Causes and solutions to the problem of ineffective code modification

message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“

@Import,Conditional和@ImportResourse注解

File upload function
![[deployment of deep learning model] deploy the deep learning model using tensorflow serving + tornado](/img/62/78abf16bb6c66726c6e394c9fb4f81.png)
[deployment of deep learning model] deploy the deep learning model using tensorflow serving + tornado

rospy Odometry天坑小计

vscode插件开发

概率论与数理统计 4 Continuous Random Variables and Probability Distributions(连续随机变量与概率分布)(上篇)

Use of dictionary tree
随机推荐
CCF 201604-2 Tetris
NPM details
CentOS install redis
An ASP code that can return to the previous page and automatically refresh the page
几个常用的网络诊断命令
腾讯云之错误[100007] this env is not enable anonymous login
[necessary for growth] Why do I recommend you to write a blog? May you be what you want to be in years to come.
C3D模型pytorch源码逐句详析(二)
文件的上传功能
message from server: “Host ‘xxx.xxx.xxx.xxx‘ is not allowed to connect to this MySQL server“
Introduction to Verdi Foundation
小程序企业发放红包功能
[recommended collection] with these learning methods, I joined the world's top 500 - the "fantastic skills and extravagance" in the Internet age
DHCP的配置(以华为eNSP为例)
canal实现mysql数据同步
Leetcode 560 前缀和+哈希表
SSM integration (simple library management system to integrate SSM)
VoxCeleb1 数据集下载
Yarn quick reference manual
数据库MySQL详解