我的笔记 FlowLayout 流式布局管理器
来源:互联网 发布:dht网络 编辑:程序博客网 时间:2024/06/10 20:46
import java.awt.*;
import javax.swing.*;
public class liushi extends JFrame{
JButton[] an={null,null,null,null,null,null,null,null};
public static void main(String[] args)
{
liushi B=new liushi();
}
public liushi()
{
an[0]=new JButton("牛奶");
an[1]=new JButton("蛋糕");
an[2]=new JButton("汽水");
an[3]=new JButton("饼干");
an[4]=new JButton("披萨");
an[5]=new JButton("巧克力");
an[6]=new JButton("面包");
an[7]=new JButton("可乐");
this.setLayout(new FlowLayout());//声明使用FlowLayout流式布局管理器 要不默认BorderLayout边界管理器
this.add(an[0]);//往JFrame里添加按钮
this.add(an[1]);
this.add(an[2]);
this.add(an[3]);
this.add(an[4]);
this.add(an[5]);
this.add(an[6]);
this.add(an[7]);
this.setTitle("流式布局FlowLayout");// 标题
//this.setLayout(new FlowLayout(FlowLayout.LEFT));//向左对齐
//this.setLayout(new FlowLayout(FlowLayout.RIGHT));//向右对齐
this.setSize(380,120);
this.setLocation(200, 200);
this.setResizable(false); //设置窗口是否可以拉伸
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setVisible(true);
}
}
0 0
- 我的笔记 FlowLayout 流式布局管理器
- FlowLayout(流式布局管理器)
- [疯狂Java笔记]AWT:布局管理器、绝对布局、FlowLayout流式布局
- FlowLayout流式布局管理器与网格布局GridLayout
- 流式管理器FlowLayout
- 边框布局管理器(BorderLayout) 流式布局管理器(FlowLayout) 表格布局管理器(GridLayout) 卡片布局管理器(CardLayout)
- 跟我学JAVA(5)图形化界面设计——布局管理器之FlowLayout(流式布局)
- FlowLayout布局管理器
- 布局管理器FlowLayout
- FlowLayout布局管理器
- FlowLayout流式布局
- FlowLayout流式布局
- 流式布局FlowLayout
- 流式布局FlowLayout
- 流式布局 FlowLayout
- FlowLayout,流式布局
- Flowlayout流式布局的使用步骤
- FlowLayout实现自定义的流式布局
- Android状态栏颜色修改
- MVC中HtmlHelper用法大全参考
- 每天一个Linux命令(42):free
- BZOJ 4657: tower
- 前台开发总结04——2017.04.13
- 我的笔记 FlowLayout 流式布局管理器
- ssh免密码登录(Ubuntu16.04版本)亲测可用,网上说的10个有9个搞不出来
- 546. Remove Boxes
- 论文笔记 Bootstrapping Face Detection with Hard Negative Examples
- 如何从Eclipse导入github上的项目源码
- 一致性HASH算法
- 在HTML中用iframe标签引入另一个页面
- 用Python对KSC数据集处理的一次排错经历
- 我的笔记 BorderLayout 边界布局管理器