Stateful

fun Stateful(state: InteractiveComponentState): PainterHint

Selects a stateful variant of an image, based on the current state. Stateful variants are Focused, Pressed, Hovered, and Disabled. If an image does not have the required stateful variant, the base one will be used.

If the state is a FocusableComponentState and its isFocused property is true, then the Focused variant will be used.

For the base image name myIcon.svg, for example:

StateStateful image names
DisabledmyIconDisabled.svg
Enabled, focusedmyIconFocused.svg
Enabled, pressedmyIconPressed.svg
Enabled, hoveredmyIconHovered.svg
Enabled, at restmyIcon.svg

Note that the Swing Compat mode value might prevent the selection of the pressed and hovered states, when true.