SwingComponentStyleScope
The properties of a JComponent. A third-party JComponent builds its own scope on this one, or on a narrower one, so every setter declared here works in its style too.
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 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 componentOrientation - the component's left-to-right / right-to-left orientation.
Sets cursor; null restores the inherited cursor.
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 font; null takes the font from the parent container.
Sets foreground; null takes the color from the parent container.
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 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 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 isVisible - whether the component is shown in its parent's layout.