自备详细注释

 /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package swingtest1; import java.awt.GridBagConstraints;
import java.awt.Insets; /**
*
* @author DaChongZi
* @param gridx
* 行坐标
* @param gridy
* 列坐标
* @param gridwidth
* 占据多少列
* @param gridheight
* 占据多少行
* @param setAnchor
* 设置单元格内的对齐方式
* @param setFill
* 设置单元格内的填充行为
*/
public class GBC extends GridBagConstraints { /**
* 设置空间所在网格坐标
*
* @param gridx
* 横轴坐标
* @param gridy
* 纵轴坐标
*/
public GBC(int gridx, int gridy) {
this.gridx = gridx;
this.gridy = gridy;
} /**
* 设置控件所在坐标以及需要占用的行列格数
*
* @param gridx
* 横轴所在坐标
* @param gridy
* 纵轴所在坐标
* @param gridwidth
* 占用行格数
* @param gridheight
* 占用列格数
*/
public GBC(int gridx, int gridy, int gridwidth, int gridheight) {
this.gridx = gridx;
this.gridy = gridy;
this.gridwidth = gridwidth;
this.gridheight = gridheight;
} /**
* 单元格内的对其方式。
* 绝对位置:east,west,south,north,northeast,northwest,southeast,southwest
* 。默认为center。 相对位置:first_line_start,line_start,first_line_end,page_start
* ,enter,page_end,
* page_end,last_line_start,line_end,last_line_end。默认为center。
*
* @param anchor
* @return
*/
public GBC setAnchor(int anchor) {
this.anchor = anchor;
return this;
} /**
* 单元格内的填充行为。 取值为none,both,norizontal,vertical。默认值为none。 * 外部填充
* 如果显示区域比组件的区域大的时候,可以用来控制组件的行为。控制组件是垂直填充,还是水平填充,或者两个方向一起填充。
*
* @param fill
* @return
*/
public GBC setFill(int fill) {
this.fill = fill;
return this;
} /**
* 指组件与表格空间四周边缘的空白区域的大小
*
* @param top
* @param bottom
* @param left
* @param right
* @return
*/
public GBC setInsets(int top, int bottom, int left, int right) {
this.insets = new Insets(top, bottom, left, right);
return this;
} /**
* 组件的横向、纵向间距
*
* @param ipadx
* @param ipady
* @return
*/
public GBC setIpad(int ipadx, int ipady) {
this.ipadx = ipadx;
this.ipady = ipady;
return this;
}
}

GridBagLayout的帮助类的更多相关文章

  1. Java类的继承与多态特性-入门笔记

    相信对于继承和多态的概念性我就不在怎么解释啦!不管你是.Net还是Java面向对象编程都是比不缺少一堂课~~Net如此Java亦也有同样的思想成分包含其中. 继承,多态,封装是Java面向对象的3大特 ...

  2. [转]JAVA布局模式:GridBagConstraints终极技巧

    最近正在 修改<公交线路查询系统>,做系统的时候都是用NULL布局,由于NULL布局调用windows系统的API,所以生成的程序无法在其他平台上应用,而 且如果控件的数量很多,管理起来也 ...

  3. [转]java gridbag 说明

    gridx = 2; // X2 gridy = 0; // Y0 gridwidth = 1; // 横占一个单元格 gridheight = 1; // 列占一个单元格 weightx = 0.0 ...

  4. Java学习笔记--Java图形用户界面

    AWT:抽象窗口组件工具包 Abstract Windows Toolkit(AWT)是最原始的 Java GUI 工具包.AWT 的主要优点是,它在 Java 技术的每个版本上都成为了一种标准配置, ...

  5. Java图形化界面设计——GridBagConstraints

    JAVA布局模式:GridBagConstraints终极技巧参数详解 布局模式 :GridBagConstraints布局,先发一个实例: gridx = 2; // X2 gridy = 0; / ...

  6. Java GridBagLayout 简单使用

    这里只介绍了很基础布局构建及使用,主要是关于 GridBagLayout. 首先整套流程大概是, 声明一个 GridBagLayout 对象 private GridBagLayout gridBag ...

  7. GridBagLayout()的使用方法

    GridBagLayout是java里面最重要的布局管理器之一,可以做出很复杂的布局,可以说GridBagLayout是必须要学好的的, GridBagLayout 类是一个灵活的布局管理器,它不要求 ...

  8. java生成字符串md5函数类(javaSE)

    //实现生成MD5值 import java.io.BufferedInputStream; import java.io.ByteArrayInputStream; import java.io.B ...

  9. javax.Swing 使用GridBagLayout的程序栗子

    摘自https://zhidao.baidu.com/question/110748776.html javax.Swing 使用GridBagLayout的程序栗子 总共两个文件,第一个是启动文件, ...

随机推荐

  1. 在html页面中利用ftp访问协议格式载入服务器图片

    访问格式为:ftp://用户名:密码@服务器ip:服务器端口/具体文件路径 如下所示: <img src="ftp://lxj:123@127.0.0.1:21/IMG_2013051 ...

  2. (转载)php获取mysql版本的几种方法小结

    (转载)http://www.jb51.net/article/13930.htm 查询当前连接的MYSQL数据库的版本,可以用下面SQL语句来实现 select VERSION(); 当前$res= ...

  3. CnPack for delphi xe5

    CnPack Team is made up of Chinese Programmers and Delphi / C++ Builder fans across the Internet. Our ...

  4. 关于HttpsURLConnection的连接问题

    本地测试好的项目拿到服务器上后,通过SSL连接,将Http改成Https,并指定了服务器的IP,结果连接失败.查了资料后发现,直接指定IP,SSL是无法定位连接的,实际上应该指定服务器端配置好的Hos ...

  5. poj 1704 Georgia and Bob(阶梯博弈)

    Georgia and Bob Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8656   Accepted: 2751 D ...

  6. [转+整理]LINUX学习笔记(1):磁盘结构及分区

    整理自: http://vbird.dic.ksu.edu.tw/linux_basic/0130designlinux_2.php http://lengjianxxxx.blog.163.com/ ...

  7. [kuangbin带你飞]专题十 匹配问题 二分图多重匹配

    二分图的多重匹配问题不同于普通的最大匹配中的"每个点只能有最多一条边" 而是"每个点连接的边数不超过自己的限定数量" 最大匹配所解决的问题一般是"每个 ...

  8. bootbox.js [v4.2.0]设置确认框 按钮语言为中文

    Bootbox.js (http://bootboxjs.com/)是一个小型的 JavaScript 库用来创建简单的可编程对话框,基于 Twitter 的 Bootstrap 开发. 弹出确认框方 ...

  9. BootStrap-table 客户端分页和服务端分页的区别

    当服务器没有对数据进行分页时,前端页面设计又要求进行分页,要分开来设置. 服务端分页: responseHandler: function(data){ return data.response; } ...

  10. 手把手教你在ubuntu下创建桌面快捷方式

    习惯使用windows的朋友来说创建桌面快捷方式简直就是so easy, 鼠标右键点击文件-->选择发送桌面快捷方式.就OK了.对于ubuntu下该如何创建桌面快捷方式呢?以下以创建eclips ...