📄 layoutflow.java
字号:
import java.awt.*;
import java.awt.event.*;
class Layoutflow extends Frame
{
Layoutflow()
{
super("顺序布局测试");
setVisible(true);
setLayout(new FlowLayout());
setBackground(Color.yellow);
add(new Button("按钮 1"));
add(new Button("按钮 2"));
add(new Button("按钮 3"));
add(new Button("按钮 4"));
pack();
setLocation(450,300);
addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
setVisible(false);
System.exit(0);
}
});
}
public static void main(String[] args)
{
Layoutflow cvs=new Layoutflow();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -