GridBagConstraints参数详解
来源:互联网 发布:java零基础教学视频 编辑:程序博客网 时间:2024/04/29 13:26
gridx = 2; // X2
gridy = 0; // Y0
gridwidth = 1; // 横占一个单元格
gridheight = 1; // 列占一个单元格
weightx = 0.0; // 当窗口放大时,长度不变
weighty = 0.0; // 当窗口放大时,高度不变
anchor = GridBagConstraints.NORTH; // 当组件没有空间大时,使组件处在北部
fill = GridBagConstraints.BOTH; // 当格子有剩余空间时,填充空间
insert = new Insets(0, 0, 0, 0); // 组件彼此的间距
ipadx = 0; // 组件内部填充空间,即给组件的最小宽度添加多大的空间
ipady = 0; // 组件内部填充空间,即给组件的最小高度添加多大的空间
new GridBagConstraints(gridx, gridy, gridwidth, gridheight, weightx, weighty, anchor, fill, insert, ipadx, ipady);
gridBagConstraints.insets = new java.awt.Insets(4, 4, 0, 4);设置组件的位置
Insets是AWT里面一个类的名字,代表着类Insets,它的用途是用来定义组件容器周围的空间大小,其中带有四个参数:
Insets(第一个参数,第二个参数,第三个参数,第
四个参数 )
第一个参数代表距上面有几个点的空白,第二个参数代
表距左边有几个点的空白,第三个参数代表距下边有几个点的空白区域,第
四个参数代表距右边留几个点的空白区域。
insets和Insets既然起的名字相同,两者之间也一
定有相同之处,它们的相似之处就在于它们的用法和用途。insets用来设置
一个组件和其他的组件之间的距离的。所以在上面程序里的按钮和其他的按
钮不同,它和其他的按钮之间都有一定的距离,而不是和其他的按钮挨在一
起。
- GridBagConstraints参数详解
- GridBagConstraints参数详解
- JAVA布局模式:GridBagConstraints终极技巧参数详解
- GridBagConstraints
- gridbagconstraints
- GridBagConstraints 网格布局的各个参数的意义
- GridBagConstraints布局
- GridBagConstraints gbc_browserButton1
- GridBagLayout和GridBagConstraints
- [转]GridBagLayout和GridBagConstraints
- 关于java 的GridBagConstraints
- java GridBagConstraints解析
- GridBagConstraints 基本属性
- GridBagLayout 以及 GridBagConstraints 用法
- GridBagLayout 以及 GridBagConstraints 用法
- 类GridBagLayout以及GridBagConstraints
- GridBagLayout 以及 GridBagConstraints 用
- JAVA布局模式:GridBagConstraints
- stl 之 优先队列
- hdu 2544 spfa
- 2014-C第2周项目—— 用if语句实现分支结构程序设计
- GridBagLayout 以及 GridBagConstraints 用法
- 影响你App成功的建议
- GridBagConstraints参数详解
- 关于iOS AppStore预览视频的制作(app preview)
- 55555555555
- vagrant上手指南
- VC控件随窗口最大化而变大或缩小
- public,private,protected访问权限在Java,C++中的解析
- 从事编程事业前应该认真思考
- ArrayList中相同元素的去除
- 设置PATH和CLASSPATH