displayedMnemonicIndex

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.

A widget derives the index again from its text and its mnemonic whenever either is written, and every pass writes this declaration back over what it derived. Declare it after the mnemonic, since a later element in the modifier chain is applied last. Removing it leaves the index the widget derives for the text and mnemonic that stand.

Throws when index is below -1 or beyond the end of the text, as Swing does - including where a shortened text is what leaves the declared index past its end.

Return

this modifier with the underlined index declared on it.

Parameters

index

the zero-based index into the text of the character to underline, or -1 to underline none of them.

See also