📄 shiyan7_5.java
字号:
import java.awt.*;
import java.awt.event.*;
public class Shiyan7_5
{
public static void main(String[] args)
{
myframe mf=new myframe();
}
}
class myframe extends Frame
{
Button []buts;
int names[]=new int[80];
myframe()
{
super("80个按钮按网格布局");
for(int j=0;j<80;j++)
names[j]=j+1;
setLayout(new GridLayout(20,4,5,5));
buts=new Button[80];
setSize(800,500);
for(int i=0;i<80;i++)
{
buts[i]=new Button("按钮"+names[i]);
buts[i].setForeground(Color.red);
buts[i].setBackground(Color.yellow);
add(buts[i]);
}
setVisible(true);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -