setAccelerator(KeyStroke.getKeyStroke('F',InputEvent.ALT_MASK));
object.setAccelerator(KeyStroke.getKeyStroke('F',InputEvent.ALT_MASK)); object.addActionListener(new objectclick()); ... private class objectclick implements ActionListener { public void actionPerformed(ActionEvent e) { ...... } }