Package-level declarations
Types
Where a child sits across the axis its container arranges children along: an Alignment.Horizontal positions a child across a Column, an Alignment.Vertical across a Row.
The receiver of a BorderPanel's content, through which a child declares which region of that panel it occupies.
The receiver of a CardPanel's content, through which a child names the card it is placed on.
The receiver of a Column's content, through which a child declares its own placement in that column.
The receiver of a GridBagPanel's content, through which a child declares the cell it occupies.
Marks the scope a layout hands its content, so that only the innermost one is in reach.
The receiver of a ScrollPane's content, through which a child declares the region of the pane it is installed in.
A hoistable state holder for the scroll position of a ScrollPane.
The receiver of a SplitPane's content, through which a child declares which of the two sides it occupies.
The receiver of a TabbedPane's content, through which a child declares the tab it is the page of.
Functions
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 JPanel under a BoxLayout: the children are laid out one after another along a single axis, in declaration order.
A JPanel under a CardLayout: a deck of cards of which exactly one is shown. The deck asks for room enough for its largest card, so showing another card does not resize it.
A composable that arranges its content vertically, top to bottom.
A JPanel under a FlowLayout: the children are laid out in a row, each at the size it prefers, and a child that no longer fits the panel's width starts a new row.
Empty space that asks for nothing and grows without bound - the glue of Box.createGlue, Box.createHorizontalGlue and Box.createVerticalGlue. A BoxPanel or a ToolBar shares the extent it has left over among its children in proportion to the room each has between its preferred and its maximum size; glue prefers nothing and has no ceiling, so its share is the largest. That share is the whole of the leftover extent where every sibling's maximum size is the size it prefers, and a part of it alongside any sibling with room to grow - room a component has until a maximum size is set on it:
A JPanel under a GridBagLayout, placing each child in the grid cell that child's own constraints describe - the row and column it starts at, the cells it spans, its share of the leftover extent, and how it fills the cell it is given.
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.
Creates and remembers a ScrollState starting at x, y.
A composable that arranges its content horizontally, along the panel's reading order.
A scrolling view onto content larger than the room it has - a JScrollPane, with the viewport it scrolls and the headers and corners that stay put beside it declared as content.
A SplitPane driven by a raw PropertyChangeListener instead of an onDividerLocationChange lambda. The listener is attached for the dividerLocation property as-is and removed on the same instance; pass a stable instance (e.g. remember {}) to avoid churn. Attached as-is, it hears every dividerLocation change the pane publishes, including the pane's own writes and, for a negative (default) dividerLocation, the position that request resolves to once realized on screen - old=-1 new=<resolved> - indistinguishable from a user's move.
Two sides of one area, split by a divider the user drags to give one side room at the other's expense
Empty space that holds size pixels along orientation and reaches for as much as it is offered across it - the strut of Box.createHorizontalStrut and Box.createVerticalStrut. A horizontal strut holds a width and takes whatever height it is given, a vertical one holds a height and takes whatever width.
A TabbedPane driven by a raw ChangeListener instead of an onSelectedIndexChange lambda. The listener is notified of the tab the user selects, and of the tab the pane is left on where selectedIndex names no tab of the strip, reading the new selection off the event's source pane; the latest declared instance is the one notified, so the listener may be declared inline.
A stack of pages of which one shows at a time, picked from a strip of tabs - a JTabbedPane. The pane holds which tab is selected and reports the tab the user clicks.
A strip of items - buttons, toggles, separators - the user reaches without opening a menu, held by a JToolBar. The bar holds whether it stands docked or in a window of its own, and reports the drags that move it between the two.
The divider that groups a ToolBar's items - JToolBar.Separator. It takes its orientation from the bar holding it, so it lies across the bar's own axis and turns with it. To divide anything else, use org.jetbrains.compose.swing.components.Separator.