I'm having problems getting underscores to appear sequentially for mnemonics in context menus in a Java Swing application running on Windows XP.
If I right-click, underscores do not appear in the pop-up menu - this is normal, as this behavior is compatible with other Windows applications.
But if I pop up the menu using the menu key (usually next to the right Windows key), the underscores do not appear for my Swing application, whereas they appear for standard Windows applications such as Wordpad and Explorer and the control panel.
The only way I can get underscores is if I hold Alt while right-clicking. Which view is useless, because if someone already clicks on the mouse to right-click, they will not want to use the keyboard to select something in the pop-up window.
Is it possible to display underscores in Swing when the context menu is invoked from a menu key? Without writing my own Look and Feel library?
source
share