I went through this question Java - How can i select all rows in JTable using Command+A shortcut in Mac? on how to add shortcut keys for Mac. I want to know if I can use this to add these shortcut keys to all components or do I have to set for each component like below:
For JTABLE:
InputMap im = myTable.getInputMap( JTable.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT );
final int CMD_BTN = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
im.put( KeyStroke.getKeyStroke( KeyEvent.VK_A, CMD_BTN ), "selectAll" );