【问题标题】:What are the parameters for a GridLayout?GridLayout 的参数是什么?
【发布时间】:2010-09-26 12:41:21
【问题描述】:
private static final GridLayout layout = new GridLayout( 3, 1, 1, 0 );

在这行代码中,数字代表什么以及如何使用它们来排列窗口中的复选框和按钮?

【问题讨论】:

    标签: java layout grid-layout


    【解决方案1】:
    【解决方案2】:

    GridLayout 类:

    public GridLayout(int rows,
                      int cols,
                      int hgap,
                      int vgap)
    
    Creates a grid layout with the specified number of rows and columns. All components in the layout are given equal size.
    In addition, the horizontal and vertical gaps are set to the specified values. Horizontal gaps are placed between each of the columns. Vertical gaps are placed between each of the rows.
    
    One, but not both, of rows and cols can be zero, which means that any number of objects can be placed in a row or in a column.
    
    All GridLayout constructors defer to this one.
    
    Parameters:
    rows - the rows, with the value zero meaning any number of rows
    cols - the columns, with the value zero meaning any number of columns
    hgap - the horizontal gap
    vgap - the vertical gap
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-02-27
      • 2014-12-30
      • 2021-06-09
      • 2011-04-14
      • 2011-04-13
      • 2014-04-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多