开发者

Java: Mnemonics and Unicode

开发者 https://www.devze.com 2023-04-06 06:30 出处:网络
I am currently having problems with unicode and mnemonics in a Java SE application. In the menu bar i added a menu with the name \"ФMnemonicUnicodeTest\" and the first letter is set as Mnemonic.

I am currently having problems with unicode and mnemonics in a Java SE application. In the menu bar i added a menu with the name "ФMnemonicUnicodeTest" and the first letter is set as Mnemonic.

The integer value which is set as mnemonic is "1060".

  • Windows 7
  • English system language
  • Java SE 6, 32bit
  • Russian / Russian k开发者_Python百科eyboard layout
  • Physical russian keyboard

Code:

menu.setMnemonic((int)(text.substring(index+1, index+2).charAt(0)));

The menu is displayed correctly (mnemonic character is underlined).

But the mnemonic does not expand the menu with "ALT + Ф" (the key is displayed at the physical keybpard as "AФ").

My question is: Why is the mnemonic not working and how can it be fixed?


Long time I haven't been doing this, but I think that for menu shortcuts, you need to use one of the virtual key values.

You might get more information in the KeyEvent javadoc.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号