How do set a shortcut, eg. Ctrl+Q, to a 开发者_如何转开发JButton
? JMenuItem
has setAccelerator()
method to set one, but JButton
doesn't.
Well, you can do a JMenu with a set og instruction, putting inside them the same ActionPerformed you put in the specified JButton. It's a good trade-off
精彩评论