JMenuItem: how to set an Accelerators with 3 keys?
问题 Please have a look at the following code import java.awt.*; import java.awt.event.*; import javax.swing.*; public class MenuActions extends JFrame { private JMenuBar jmb; private JMenu file; private JMenuItem open; public MenuActions() { jmb = new JMenuBar(); file = new JMenu("File"); open = new JMenuItem("Open"); open.addActionListener(new MenuAction()); open.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O,KeyEvent.VK_P,ActionEvent.CTRL_MASK)); file.add(open); jmb.add(file); this