How are Mnemonics On Buttons Supposed To Work?
John_Smith at symantec.com
Mon Jul 1 13:29:21 PDT 2013
Are you using OS X?
For me, mnemonics in JavaFX work on Windows, but not at all in OS X (which is perhaps by undocumented design?).
Apple's platform integration guide contains a section on Mnemonics, it based on Swing but I think the concepts translate to JavaFX:
>The JMenuItem class inherits the concept of mnemonics from the JAbstractButton class. In the context of menus, mnemonics are shortcuts to menus and their contents, which are executed by using a modifier key in conjunction with a single letter. When you set a mnemonic in a menu item, Java underscores the mnemonic letter in the title of the JMenuItem or JMenu component when the Option key is held down. Using mnemonics is discouraged in OS X, because mnemonics violate the principles of OS X Human Interface Guidelines. If you are developing a Java application for multiple platforms and some of those platforms recommend the use of mnemonics, just include a single setMnemonics() method that is conditionally called (based on the platform) when constructing your interface.
> How then do you get the functionality of mnemonics without using Java's mnemonics? If you have defined a keystroke sequence in the setAccelerator() method for a menu item, that key sequence is automatically entered into your menus.
Accelerators work on both Windows and OS X (http://stackoverflow.com/questions/12710468/using-javafx-2-2-mnemonic).
From: openjfx-dev-bounces at openjdk.java.net [mailto:openjfx-dev-bounces at openjdk.java.net] On Behalf Of Mark Fortner
Sent: Monday, July 01, 2013 10:35 AM
To: openjfx-dev at openjdk.java.net
Subject: How are Mnemonics On Buttons Supposed To Work?
Recently, I added mnemonics to some buttons and enabled mnemonic parsing, and noticed that the mnemonic isn't rendered. I came across this issue:
which seems to indicate that NOT showing mnemonics is the expected behavior.
If that's correct, how are user's supposed to know what mnemonics are available?
More information about the openjfx-dev