class org.aswing.GridLayout extends EmptyLayout

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.

The picture below shows the panel with 2 rows and 3 columns:

Authors: feynixs(Cai Rong), paling, ngrebenshikov

Instance Fields

Show inherited public instance fieldsHide inherited public instance fields

Inherited from EmptyLayout

function addLayoutComponent(comp:Component, constraints:Dynamic):Void
function getLayoutAlignmentX(target:Container):Float
function getLayoutAlignmentY(target:Container):Float
function invalidateLayout(target:Container):Void
function layoutContainer(target:Container):Void
function maximumLayoutSize(target:Container):IntDimension
function minimumLayoutSize(target:Container):IntDimension
function preferredLayoutSize(target:Container):IntDimension
function removeLayoutComponent(comp:Component):Void

var columns:Int

This is the number of columns specified for the grid. The number of columns can be changed at any time. This should be a non negative integer, where '0' means 'any number' meaning that the number of Columns in that dimension depends on the other dimension.

var hgap:Int

This is the horizontal gap (in pixels) which specifies the space between columns. They can be changed at any time. This should be a non-negative integer.

var rows:Int

This is the number of rows specified for the grid. The number of rows can be changed at any time. This should be a non negative integer, where '0' means 'any number' meaning that the number of Rows in that dimension depends on the other dimension.

var vgap:Int

This is the vertical gap (in pixels) which specifies the space between rows. They can be changed at any time. This should be a non negative integer.

function new(?rows:Int = 1, ?cols:Int = 0, ?hgap:Int = 0, ?vgap:Int = 0): Void

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.

Throws ArgumentError if the value of both rows and cols is set to zero

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

(optional)the horizontal gap, default 0

vgap

(optional)the vertical gap, default 0

function toString(): String