当前位置:网站首页>GUI window
GUI window
2022-07-25 10:15:00 【Look at the bugs】
Layout manager job
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);
// close window
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}
边栏推荐
猜你喜欢

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

Copy the old project into a web project

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

CentOs安装redis
![[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)](/img/6e/da80133e05b18c87d7167c023b6c93.gif)
[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)

DHCP的配置(以华为eNSP为例)

JS uses requestanimationframe to detect the FPS frame rate of the current animation in real time

VoxCeleb1 数据集下载

@Import, conditional and @importresource annotations

VLAN的配置及其应用(以华为eNSP为例)
随机推荐
IO流中的输出流
GCD详解
数论--约数研究
21. Merge Two Sorted Lists
ES6 detailed explanation
vant问题记录
IDEA整体字体大小修改
CentOS install redis
Detailed explanation of MySQL database
framework打包合并脚本
MVC three-tier architecture understanding
[RNN] analyze the RNN from rnn- (simple|lstm) to sequence generation, and then to seq2seq framework (encoder decoder, or seq2seq)
修改mysql的分组报错Expression #1 of SELECT list is not in GROUP
Redis使用场景
@Import,Conditional和@ImportResourse注解
See how a junior student of double non-2 (0 Internship) can get an offer from Alibaba and Tencent
Use of dictionary tree
Loam transformtoend function integrating IMU details
[recommended collection] with these learning methods, I joined the world's top 500 - the "fantastic skills and extravagance" in the Internet age
Chrome开发者工具详解