package test;
import java.awt.*;
import javax.swing.*;
public class J090801 extends JFrame {
JButton bu1,bu2,bu3,bu4,bu5,bu6,bu7,bu8;
public static void main(String[] args) {
J090801 j01=new J090801();
}
public J090801()
{
bu1=new JButton("落");
bu2=new JButton("花");
bu3=new JButton("有");
bu4=new JButton("意");
bu5=new JButton("随");
bu6=new JButton("流");
bu7=new JButton("水");
bu8=new JButton(",");
this.setTitle("网格布局管理器GridLayout练习");
this.setLayout(new GridLayout(2,3,15,15));//15,15为按钮间的间距
this.add(bu1);
this.add(bu2);
this.add(bu3);
this.add(bu4);
this.add(bu5);
this.add(bu6);
this.add(bu7);
this.add(bu8);
this.setSize(320, 260);
this.setLocation(100, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setResizable(true);
this.setVisible(true);
}
}