|
KeyStroke group = KeyStroke.getKeyStroke(KeyEvent.VK_F4);
tfGroup.getInputMap().put(group, "Group");
Action groupAction = new AbstractAction() {
public void actionPerformed(ActionEvent e) {
// add ur code here
}
};
tfGroup.getActionMap().put("Group", groupAction);
here tfGroup is TextField(Java Component) . when the Focus is on this tfGroup then press F4 .
|