displayedMnemonicIndex

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

The index is applied after the mnemonic, wherever it appears in the style. Once the style stops setting it, the label keeps the index it derives for the text and mnemonic that stand.

Swing refuses an index below -1 or past the end of the text: setting one throws, and where a later text no longer reaches it, the label keeps the index it derives.

Parameters

index

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

See also


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.

The index is applied after the mnemonic, wherever it appears in the style. Once the style stops setting it, the button keeps the index it derives for the text and mnemonic that stand.

Swing refuses an index below -1 or past the end of the text: setting one throws, and where a later text no longer reaches it, the button keeps the index it derives.

Parameters

index

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

See also