📄 j03090403.java
字号:
import java.lang.*;
import java.awt.*;
public class j03090403 extends Frame
{
Button B1,B2,B3,B4,B5; //Button 组件
public j03090403()
{
//使用某一种版面编排器
this.setLayout( new GridLayout( 0, 2 )
);
//表示:不指定几列,但要 2 栏
B1 = new Button("仙草一");
this.add(B1);
B2 = new Button("仙草二");
this.add(B2);
B3 = new Button("仙草三");
this.add(B3);
B4 = new Button("仙草四");
this.add(B4);
B5 = new Button("仙草五");
this.add(B5);
//=====================================================
this.setBounds(200,100,250,180); //设定窗口的位置和大小
this.setTitle("使用 GridLayout"); //设定此窗口的标题文字
this.setVisible(true); //要显示此Frame
}
public static void main(String[] para)
{
new j03090403(); //建一个 Frame 子类的窗口
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -