GridBagPanelScope

sealed interface GridBagPanelScope

The receiver of a GridBagPanel's content, through which a child declares the cell it occupies.

Children are written plainly; what a child declares here rides along on its modifier:

GridBagPanel {
Label(text = "Name", modifier = SwingModifier.item(gridx = 0, gridy = 0))
Button(text = "Pick", onClick = ::pick, modifier = SwingModifier.item(gridx = 1, gridy = 0, weightx = 1.0))
}

See also

Functions

Link copied to clipboard
abstract fun SwingModifier.item(gridx: Int = GridBagConstraints.RELATIVE, gridy: Int = GridBagConstraints.RELATIVE, gridwidth: Int = 1, gridheight: Int = 1, weightx: Double = 0.0, weighty: Double = 0.0, anchor: Int = GridBagConstraints.CENTER, fill: Int = GridBagConstraints.NONE, insets: Insets = DefaultInsets, ipadx: Int = 0, ipady: Int = 0): SwingModifier

Places the child in the cell these constraints describe. The parameters carry GridBagConstraints' own field names and defaults, so a grid-bag layout written against Swing transfers field for field.