Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
JMenuItemにホットキーを追加したいと思います。CTRL+SOME_KEYのようなキーを追加する方法を学びました。しかし、私が必要としているのは、トリプルホットキーです。CTRL + ALT+Wのようなもの。JMenuItemにホットキーを追加したいと思います。しかし、どのようにそのようなホットキーを作成する必要がありますか?
これがあなたのために働くかどうかわかりますか?
menuItem.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_W, ActionEvent.ALT_MASK + ActionEvent.CTRL_MASK ));
別:
menuItem.setAccelerator(KeyStroke.getKeyStroke("control alt W"));