Hi, I just want to capture the "ctrl D" key so I can delete the active
row on a JTable. Here's what I do:
table.getActionMap().put("deleteJob", new TestAction());
table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(KeyStroke.getKeyStroke("control
D"), "deleteJob");
My it's doesn't work at all. The "TestAction" class extend
"AbstractAction" and I just do a System.out.println("it work") in the
"actionPerformed" method just to see if it work.
Any help please!
Ciao!
John McGrath - 28 Dec 2004 08:35 GMT
> table.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT)
Did you try using WHEN_FOCUSED?

Signature
Regards,
John McGrath