We want to show a hint for JList that the user can select multiple items with a platform-dependent key for the multi selector.
However, I did not find a way to display the OS X COMMAND character in JLabel, which means the character that was typed on the apple keyboard on the command key, also called the apple key.
Here is the symbol that I want to display on OS X. 
I also want it to be platform independent.
those. sort of
component.add( new JList() , BorderLayout.CENTER );
component.add( new JLabel( MessageFormat.format("With {0} you can "
+ "select multiple items",
KeyStroke.getKeyStroke( ... , ... ) ) ) , BorderLayout.SOUTH );
Where instead of {0} it should appear above the seen symbol ...
Do any of you know how to do this? I know this is possible, since there is a symbol in JMenuItems ...
My own (non-graphical solutions) look like this:
add( new JLabel( MessageFormat.format(
"With {0} you can select multiple items" ,
System.getProperty( "mrj.version" ) != null ? "COMMAND" : "CTRL" ) ) ,
BorderLayout.SOUTH );
source
share