BorderPanel

@Composable
fun BorderPanel(modifier: SwingModifier = SwingModifier, hgap: Int = 0, vgap: Int = 0, content: @Composable BorderPanelScope.() -> Unit)

A JPanel under a BorderLayout, placing each child in the region that child names: the four edges and the center. An edge child keeps the thickness it prefers and spans its edge, and the center child takes whatever the edges leave.

A child names its region on its own modifier, through BorderPanelScope:

BorderPanel {
Toolbar(modifier = SwingModifier.north())
Editor()
StatusBar(modifier = SwingModifier.south())
}

A child that names no region occupies the center, so the panel's main content is written plainly.

A region hosts one child: dropping a child (e.g. behind an if) empties the region it occupied, and an edge no child names holds nothing.

Parameters

modifier

the SwingModifier applied to the panel

hgap

the horizontal gap between regions; 0 by default, so they touch

vgap

the vertical gap between regions; 0 by default, so they touch

content

the composable content of the panel; see BorderPanelScope

See also