当前位置: 首页 > news >正文

绵阳做网站的公司淘口令微信网站怎么做

绵阳做网站的公司,淘口令微信网站怎么做,深度网营销型网站建设公司怎么样,网络营销产品推广方案GridBagLayout以表格形式布置容器内的组件#xff0c; 将每个组件放置在每个单元格内#xff0c;而一个单元格可以跨越多个单元格合并成一个单元格#xff0c;即多个单元格可以组合成一个单元格#xff0c;从而实现组件的自由布局。每一个单元格都有各自的属性#xff0c;…GridBagLayout以表格形式布置容器内的组件 将每个组件放置在每个单元格内而一个单元格可以跨越多个单元格合并成一个单元格即多个单元格可以组合成一个单元格从而实现组件的自由布局。每一个单元格都有各自的属性而这些属性由GridBagConstrainsts类的成员变量来定义且GridBagConstriaints中的所有成员变量都是public的。构造函数 GirdBagLayout()建立一个新的GridBagLayout管理器。 GridBagConstraints()建立一个新的GridBagConstraints对象。 GridBagConstraints(int gridx,int gridy,int gridwidth,int gridheight,double weightx,double weighty,int anchor,int fill, Insets insets,int ipadx,int ipady) 建立一个新的GridBagConstraints对象并指定其参数的值。下面提供一个用来设置GridBagConstraints对象各参数的帮助类 import java.awt.GridBagConstraints; import java.awt.Insets; /**1. 2. author han3. 功能用来设置GridBagConstraints对象的一些参数4. */ public class GBC extends GridBagConstraints {/*** 初始化左上角位置 gridx,gridy —— 设置组件的位置* gridx0,gridy0时放在0行0列。* * param gridx* param gridy*/public GBC(int gridx, int gridy) {this.gridx gridx;this.gridy gridy;}/*** 初始化左上角位置和所占行数和列数* * gridwidth,gridheight —— 用来设置组件所占的单位长度与高度默认值皆为1。* 可以使用GridBagConstraints.REMAINDER常量* 代表此组件为此行或此列的最后一个 组件而且会占据所有剩余的空间。* * 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;}/*** 对齐方式 anchor设置组件在单元格中的对齐方式。* 由以下常量来定义* * GridBagConstraints.CENTER* * GridBagConstraints.EAST* * GridBagConstraints.WEST* * GridBagConstraints.SOUTH* * GridBagConstraints.NORTH* * GridBagConstraints.SOUTHEAST* * GrisBagConstraints.SOUTHWEST* * GridBagConstraints.NORTHEAST* * GridBagConstraints.NORTHWEST* * param anchor* return*/public GBC setAnchor(int anchor) {this.anchor anchor;return this;}/*** 是否拉伸及拉伸方向* * fill当某个组件未能填满单元格时可由此属性设置横向、* 纵向或双向填满。由以下常量来定义* * GridBagConstraints.NONE* * GridBagConstraints.HORIZONTAL* * GridBagConstraints.VERTICAL* * GridBagConstraints.BOTH* * param fill* return*/public GBC setFill(int fill) {this.fill fill;return this;}/*** x和y方向上的增量* * weightx,weighty——用来设置窗口变大时各组件跟着变大的比例。 * 当数字越大表示组件能得到更多的空间默认值皆为00-1。* * param weightx* param weighty* return*/public GBC setWeight(double weightx, double weighty) {this.weightx weightx;this.weighty weighty;return this;}/*** 外部填充* * param distance* return*/public GBC setInsets(int distance) {this.insets new Insets(distance, distance, distance, distance);return this;}/*** 外填充* * insets —— 设置组件之间彼此的间距。* 它有四个参数分别是上左下右默认为(0,0,0,0)。* * param top* param left* param bottom* param right* return*/public GBC setInsets(int top, int left, int bottom, int right) {this.insets new Insets(top, left, bottom, right);return this;}/*** 内填充* * ipadx,ipady —— 设置组件间距默认值为0。* * param ipadx* param ipady* return*/public GBC setIpad(int ipadx, int ipady) {this.ipadx ipadx;this.ipady ipady;return this;} } GridBagLayout布局的一个案例—-使三个带颜色的面板一直在Frame窗口的中央显示无论窗口放大还是缩小 import java.awt.Color; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import java.awt.GridBagLayout; /*** * author han* * 使用GridBagLayout布局的一个案例* * 功能使三个带颜色的面板一直在Frame窗口的中央显示无论窗口放大还是缩小* */ public class GridBagLayoutTest extends JFrame {private static final long serialVersionUID 1391949900949468015L;private JPanel contentPane;public static void main(String[] args) {EventQueue.invokeLater(new Runnable() {public void run() {try {GridBagLayoutTest frame new GridBagLayoutTest();frame.setVisible(true);} catch (Exception e) {e.printStackTrace();}}});}public GridBagLayoutTest() {setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);setBounds(100, 100, 511, 500);setTitle(GridBagLayout布局案例);contentPane new JPanel();setContentPane(contentPane);GridBagLayout gbl_contentPane new GridBagLayout();contentPane.setLayout(gbl_contentPane);JPanel jPanel1 new JPanel();jPanel1.setSize(300, 100);jPanel1.setBackground(Color.blue);JPanel jPanel2 new JPanel();jPanel2.setSize(300, 300);jPanel2.setBackground(Color.red);JPanel jPanel3 new JPanel();jPanel3.setSize(300, 100);jPanel3.setBackground(Color.YELLOW);//如果加入的是空的面板时需要把内部填充的大小与面板size的大小设为一样。contentPane.add(jPanel1, new GBC(0, 1).setInsets(20, 0, 20, 0).setWeight(1, 0).setIpad(300, 100));contentPane.add(jPanel2, new GBC(0, 2).setInsets(20, 0, 20, 0).setWeight(1, 0).setIpad(300, 100));contentPane.add(jPanel3, new GBC(0, 3).setInsets(20, 0, 20, 0).setWeight(1, 0).setIpad(300, 100));}}
http://www.hkea.cn/news/14465996/

相关文章:

  • 电子商务网站建设及推广方案嘉定营销型 网站制作
  • 推进地方文明网站建设网站备案很麻烦吗
  • 21dove谁做的的网站竞价托管开户
  • 网站的数据库有什么用网页自助建站
  • 网站程序 制作个人能接做网站的活么
  • seo网站推广怎样网站建设中所涉及的所有链接建设
  • 百度网站做防水补漏做甜品台的网站
  • 网站淘宝客 难做制作ppt的软件电脑版
  • 网站建设公司与前端莱芜app下载
  • 网络公司网站设计维护合同在线视频网站怎么做seo
  • 网站开发工具论文wdcp v3搭建WordPress
  • 广西商城网站建设淄博做淘宝网站
  • 导航滑动整屏网站今天发生了什么重大新闻
  • 某企业网站建设方案论文wordpress门户主题 门户一号下载
  • 站长之家站长工具可视化网站后台
  • 会计公司网站源码动态页面制作
  • 网站成功案例设计品牌加盟网
  • 人工智能网站应怎么做手机网站建设动态
  • 一个虚拟主机做2个网站设计吧 网站
  • 自己做的网站别人查看seo优化是做什么的
  • 邳州网站开发app外包平台大概多少钱
  • 网店加盟全屏网站 图片优化
  • ui做标注的网站19年做哪个网站致富
  • 快速网站制作转转钓鱼链接怎么制作
  • 福建高速公路建设指挥部网站wordpress导入汉化包
  • 网站上线具体流程开网店流程图文详解
  • 网站开发汇报ppt模板四川省德阳市建设招投标网站
  • 青岛app网站开发html5软件下载手机版
  • 定兴做网站的wordpress 必装插件
  • 网站里面的视频功能怎么做网站开发主机的选择