public class XXX
{
public static void main(String args[]) {
JComponent comp = new JTable(); // some panel or table
comp.getInputMap().put(KeyStroke.getKeyStroke("F4"), "xxxaction");
comp..getActionMap().put("xxxaction", new XXXAction());
}
public class XXXAction extends AbstractAction
{
@Override
public void actionPerformed(ActionEvent e)
{
// Something;
}
}
}
Is there a way to execute the invoked action XXXAction() without pressing 'F4' using the ActionMap lookup??
Many thanks in advance!!!