Package-level declarations

Types

Link copied to clipboard
@Stable
class LabelTarget

A reference to the component a label captions. Obtain one from rememberLabelTarget, attach it to the captioned component with the labelTarget modifier, and pass it to a label's labelFor modifier; the label's JLabel.setLabelFor is then wired to that component so the label's mnemonic moves focus to it and assistive technologies read the two as a pair.

Functions

Link copied to clipboard

Sets the component's accessible description - a longer localized explanation assistive technologies can read after the name. null clears any description this modifier set.

Link copied to clipboard

Sets the component's accessible name - the short localized string assistive technologies announce for it. null clears any name this modifier set. Mirrors Compose's semantics { contentDescription = ... }.

Link copied to clipboard

Sets which occurrence of the mnemonic letter in the 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.

Link copied to clipboard

Marks this label as the caption for the component bound to target via the labelTarget modifier, wiring JLabel.setLabelFor to that component. Requires a JLabel target.

Link copied to clipboard

Marks this component as the captioned target of target, so a label whose labelFor modifier carries the same target wires its JLabel.setLabelFor to this component.

Link copied to clipboard

Sets the keyboard mnemonic to the key that types mnemonic, resolved with KeyEvent.getExtendedKeyCodeForChar - so 's' and 'S' both declare the S key. A character that appears on no known keyboard layout resolves to KeyEvent.VK_UNDEFINED, declaring no mnemonic.

Sets the keyboard mnemonic to the key identified by keyCode, a KeyEvent.VK_* value. KeyEvent.VK_UNDEFINED declares no mnemonic.

Link copied to clipboard

Creates and remembers a LabelTarget that associates a label with the component it captions.