I'm trying to enable ctrl c on the actual cell of the Jtable, instead of the whole row. I know how to disable the ctrl c on the whole row.
KeyStroke cStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK);
inputMap.put(cStroke, "none");
I have tried the following to add a ctrl c to the cell itself: adding a keylistener to the table itself. It did not work. And the following code:
Action actionListener = new AbstractAction() {
public void actionPerformed(ActionEvent actionEvent) {
System.out.println("activated");
}
};
KeyStroke cStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C, InputEvent.CTRL_MASK);
inputMap.put(cStroke, actionListener);
It did not print activated.
I have read JTable: override CTRL+C behaviour but it does not contain an answer, at least not a specific answer..