Keys shortcuts, Java
문제
I want to add a hotkey to JMenuItem. I learned how to add key that look like CTRL+SOME_KEY. But what I need, is a triple hotkey. Somthing like CTRL+ALT+W. I want to add a hotkey to JMenuItem. But how should I create such hotkey?
해결책
Can you see if this will work for you?
menuItem.setAccelerator(KeyStroke.getKeyStroke(
KeyEvent.VK_W, ActionEvent.ALT_MASK + ActionEvent.CTRL_MASK ));
다른 팁
Alternative:
menuItem.setAccelerator(KeyStroke.getKeyStroke("control alt W"));
제휴하지 않습니다 StackOverflow