ButtonStyleScope
What a style can set on a component backed by a javax.swing.AbstractButton: any button or menu item.
Inheritors
Properties
Functions
Sets the component's accessible description - a longer localized explanation assistive technologies can read after the name. null clears any description this style set.
Sets the component's accessible name - the short localized string assistive technologies announce for it. null clears any name this style set. Mirrors AndroidX's semantics { contentDescription = ... }.
Sets the command string a button puts on the ActionEvent it fires, read back as event.actionCommand. It tells two buttons apart inside one shared listener, and it stays put when the button's text changes with the locale. null restores the default, where a button reports its own text as the command.
Sets the horizontal alignment along the x axis, where 0.0 aligns to the left, 0.5 centers, and 1.0 aligns to the right. A parent that honors alignment - a vertical BoxLayout - lines its children up by this value, so siblings given the same alignment stay in one column.
Sets the vertical alignment along the y axis, where 0.0 aligns to the top, 0.5 centers, and 1.0 aligns to the bottom. A parent that honors alignment - a horizontal BoxLayout - lines its children up by this value, so siblings given the same alignment stay on one row.
Applies this style to the receiving scope.
Sets background; on a non-opaque component also set opaque to true for it to paint.
Sets the component's border. null removes it.
Sets whether a button paints its border.
Sets componentOrientation - the component's left-to-right / right-to-left orientation.
Sets whether a button fills the area behind its content.
Sets cursor; null restores the inherited cursor.
Sets the icon a button displays while it is disabled; null hands the state back to the look and feel, which grays the base icon for it.
Sets the icon a button displays while it is both disabled and selected; null hands the state back to the look and feel, which grays selectedIcon for it, or falls back to the disabled icon where the button carries no selected icon.
Sets which occurrence of the mnemonic letter in the button's text is underlined, as a zero-based index into the text; -1 underlines none of them. Use it when the letter appears more than once and the first one is not the one to decorate - displayedMnemonicIndex(5) underlines the A of Save As.
Sets an invisible border occupying insets. See emptyBorder (the four-side form).
Sets an invisible border of all on every side. See emptyBorder (the four-side form).
Sets an invisible border with the specified space on each side. margin is the space a button or text component keeps inside its border. See border for precedence and restoration.
Sets isEnabled on this component only, controlling whether it responds to user input and paints in its enabled state. To disable descendants, use provideNestedStyle(AllComponents) { enabled(false) } on a container. The provided style does not disable the container itself, and a descendant's own enabled(true) overrides it.
Sets isFocusable, declaring whether this component can receive keyboard focus.
Sets whether a button paints the indicator showing it holds keyboard focus.
Sets font; null takes the font from the parent container.
Sets foreground; null takes the color from the parent container.
Sets where a button's content sits along its width, when it is given more width than it needs.
Sets which side of the icon a button draws its text on; a button with no icon lays out the same either way.
Sets the icon a button displays beside its text; null displays none.
Sets the space between a button's icon and its text.
Sets the space a button keeps between its border and its content.
Sets maximumSize and relays out; null restores the layout-computed maximum size.
Sets maximumSize to Dimension(width, height) and relays out.
Sets minimumSize and relays out; null restores the layout-computed minimum size.
Sets minimumSize to Dimension(width, height) and relays out.
Sets the button's keyboard mnemonic to the key that types mnemonic, resolved with KeyEvent.getExtendedKeyCodeForChar - so 's' and 'S' both set the S key. A character that appears on no known keyboard layout resolves to KeyEvent.VK_UNDEFINED, setting no mnemonic.
Sets the button's keyboard mnemonic to the key identified by keyCode, a KeyEvent.VK_* value. KeyEvent.VK_UNDEFINED sets no mnemonic.
Sets isOpaque - required for background to actually paint.
Sets preferredSize and relays out; null restores the layout-computed preferred size.
Sets preferredSize to Dimension(width, height) and relays out.
Sets the icon a button displays while it is held down; null falls back to the base icon.
Sets whether a button paints its rollover state - the look it takes while the pointer is over it.
Sets the icon a button displays while the pointer is over it; null falls back to the base icon. Setting it switches rolloverEnabled on.
Sets the icon a button displays while the pointer is over it and it is selected; null falls back to selectedIcon. Setting it switches rolloverEnabled on.
Sets the icon a button displays while it is selected - a checked check box, an on toggle button; null falls back to the base icon.
Sets the component's actual size to size, like setSize. See size (the Int overload) for when this takes effect and how size/width/height compose.
Sets the component's actual size to width by height, like setSize. A layout manager overrides this on its next layout pass, so it takes effect for components positioned by themselves - those in a null layout or a JLayeredPane. To influence a managed layout, use preferredSize, minimumSize, or maximumSize instead.
Sets the tooltip for the pointer's location. text returns null where no tooltip is available.
Sets the tooltip for the whole component. null clears it.
Whether the inputVerifier of the component that currently holds the keyboard is consulted before focus moves to this component. Swing's own value is true; set false on a control that must act regardless of what the focused field holds, such as a Cancel button or a scrollbar.
Sets where a button's content sits along its height, when it is given more height than it needs.
Sets whether a button draws its text above, across or below the icon; a button with no icon lays out the same either way.
Sets isVisible - whether the component is shown in its parent's layout.