RigidArea

@Composable
fun RigidArea(width: Int, height: Int, modifier: SwingModifier = SwingModifier)

Empty space of a fixed size, width by height pixels - the rigid area of Box.createRigidArea.

Its minimum, preferred and maximum size are all that size, so a BoxPanel or a ToolBar holds it at exactly that size - which is what makes it the gap between two items:

BoxPanel(axis = BoxLayout.X_AXIS) {
Button(text = "Cancel", onClick = { ... })
RigidArea(width = 8, height = 0)
Button(text = "OK", onClick = { ... })
}

A Row and a Column gap their children through their arrangement, Arrangement.spacedBy.

Parameters

width

the horizontal size in pixels

height

the vertical size in pixels

modifier

the SwingModifier applied to the underlying component

See also