开发者

Creating Button Shortcuts with Java like & (ampersand) with Windows Forms

I wish I could word this question better. Partly I just don't know the name of what I'm looking for.

With Visual Studi开发者_如何学JAVAo and Windows forms you can add an ampersand to create a "shortcut" key to a button by pressing Alt + [That Letter]. Like My &Button ... Alt + B would be the shortcut.

Is there an equivalent of this in Java SWING? I am using NetBeans IDE 6.9.1.

Thank you all!


That's called a mnemonic.

Use setMnemonic (javadoc)

See http://download.oracle.com/javase/tutorial/uiswing/components/menu.html#mnemonic


You use JMenutItem.setMnemonic(); I don't think there's a handy-dandy shortcut like the ampersand.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜