Sunday, 15 September 2013

Is there a way to set underline to mnemonic character in native look and feel under Win 7?

Is there a way to set underline to mnemonic character in native look and
feel under Win 7?

My code:
fileMenu = new JMenu("File");
fileMenu.setMnemonic(KeyEvent.VK_F);
fileMenu.setDisplayedMnemonicIndex(0);
Javadocs for AbstractButton.setDisplayedMnemonicIndex() say that
Not all look and feels may support this.
I set my look and feel to UIManager.getSystemLookAndFeelClassName()
And I don't see underline on mnemonic even when the index is explicitely
set by setDisplayedMnemonicIndex() - under Windows 7.
It works however if I do not set the look & feel and leave just default
java theme.
Is there a way to achieve this? Is it caused by the settings of Windows ?

No comments:

Post a Comment