📄 testgridlayout.java
字号:
import java.awt.*;
public class TestGridLayout {
public static void main(String args[]) {
Frame f = new Frame("Grid Layout");
Button[] buttons = new Button[20];
for( int i=0; i<buttons.length; i++)
buttons[i] = new Button( ""+(i+1) );
f.setLayout(new GridLayout(4,5));
for( int i=0; i<buttons.length; i++)
f.add( buttons[i] );
f.setSize(200,200);
f.setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -