java之JFrame流式布局

本文详细介绍了Java中JFrame如何使用流式布局管理器,通过实例展示了流式布局的特点和配置方法,帮助读者理解如何在窗口中组织组件。
摘要由CSDN通过智能技术生成
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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值