📄 layoutbord.java
字号:
import java.awt.*;
import java.awt.event.*;
class LayoutBord extends Frame
{
LayoutBord()
{
super("边界布局测试");
setVisible(true);
setLayout(new BorderLayout());
setBackground(Color.yellow);
add(new Button("东按钮"),"East");
add(new Button("西按钮"),"West");
add(new Button("南按钮"),"South");
add(new Button("北按钮"),"North");
add(new Button("中央按钮"),"Center");
pack();
setLocation(550,300);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
setVisible(false);
System.exit(0);
}
});
}
public static void main(String[] args)
{
LayoutBord cvs=new LayoutBord();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -