Java: keyboard shortcut (mnemonic) for a Component
I have a JFrame
and some JButto开发者_高级运维ns
, JLabels
and a JTextfield
.
I need to create a keyboard shortcut so that when it is pressed, the JTextfield
gets the focus.
How can I do this?
Thanks
Maybe you are looking for:
label.setLabelFor( textField );
Otherwise you need to use Key Bindings.
精彩评论