📄 grid.java
字号:
import java.awt.*;
public class Grid extends Frame{
public Grid(){
//this.setLayout(new GridLayout());
//this.setLayout(new GridLayout(2,2));
this.setLayout(new GridLayout(2,2,10,5));
add(new Button("1"));
add(new Button("2"));
add(new Button("3"));
add(new Button("4"));
add(new Button("5"));
//add(new Button("6"));
this.setSize(400,400);
this.setVisible(true);
}
public static void main(String[] args){
Grid s = new Grid();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -