|
JTable.getInputMap(JInternalFrame.WHEN_ANCESTOR_OF _FOCUSED_COMPONENT)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "SOME_ACTION");
JTable.getInputMap(JInternalFrame.WHEN_FOCUSED)
.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "SOME_ACTION");
JTable.getActionMap().put("SOME_ACTION", actions);
actions = new AbstractAction() {
public void actionPerformed(ActionEvent ae) {
//This action will get fired on Enter Key
}
};
|