Java - How can i select all rows in JTable using Command+A shortcut in Mac?
问题 I have many tables in my Java application. When i click "Ctrl + A" in Mac OS X, it selects all rows inside the current table. I wonder if i can change the default shortcut to use "Command + A" instead to select all the rows in the table ? I am trying to do this inside the EventQueue class to be applied automatically on all the tables in my application. 回答1: Swing uses Key Bindings to map KeyStrokes to Actions . So you can add another binding to map "Command A" to the existing "Control A"