📄 gridlayoutdemo.java
字号:
import java.awt.*;
import java.applet.*;
public class GridLayoutDemo extends Applet
{
static final int n=4;
public void init()
{
setLayout(new GridLayout(n,n));
setFont(new Font("Times New Roman",Font.BOLD,24));
for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
{
int k=i*n+j;
if(k>0)
add(new Button(""+k));
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -