package test;
import java.awt.*;
import javax.swing.*;
public class demo extends JFrame{
private JButton jb = null;
private JButton jb1 = null;
private JButton jb2 = null;
private JButton jb3 = null;
private JButton jb4 = null;
private JButton jb5 = null;
private JButton jb6 = null;
private JButton jb7 = null;
public static void main(String[] args){
demo demo1 = new demo();
}
//构造函数
public demo(){
jb = new JButton("麒麟");
jb1 = new JButton("青龙");
jb2 = new JButton("朱雀");
jb3 = new JButton("白虎");
jb4 = new JButton("玄武");
jb5 = new JButton("赑屃");
jb6 = new JButton("蒲牢");
jb7 = new JButton("貔貅");
this.setLayout(new FlowLayout());
this.add(jb);
this.add(jb1);
this.add(jb2);
this.add(jb3);
this.add(jb4);
this.add(jb5);
this.add(jb6);
this.add(jb7);
this.s
java之JFrame流式布局
最新推荐文章于 2022-04-25 11:59:03 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)