GridPanel

@Composable
fun GridPanel(modifier: SwingModifier = SwingModifier, rows: Int = 1, cols: Int = 0, hgap: Int = 0, vgap: Int = 0, content: @Composable () -> Unit = {})

A JPanel under a GridLayout: the panel is divided into equally sized cells and the children fill them one per cell, row by row in the panel's reading order.

A zero rows means as many rows as the children need, and a zero cols as many columns; one of the two may be zero, never both.

Parameters

modifier

the SwingModifier applied to the panel

rows

the number of rows, or 0 for as many as the children need; the default 1 puts every child in one row

cols

the number of columns, or 0 for as many as the children need; a non-zero rows takes precedence, and the column count then follows from the row count and the number of children

hgap

the horizontal gap between components; 0 by default, so columns touch

vgap

the vertical gap between components; 0 by default, so rows touch

content

the composable content of the panel; empty by default

See also

Throws

if both rows and cols are zero