Article View: borland.public.jbuilder.java.api
Article #971Re: How to set HotKey in Menu and Button?
From: John McGrath TeamB
Date: Sat, 29 Jun 2002 05:39
Date: Sat, 29 Jun 2002 05:39
38 lines
2428 bytes
2428 bytes
On Sat, 29 Jun 2002 08:49:21 +0800, timothy wrote:
> > > > > How to set HotKey in Menu and Button?
> I'm using jButton.
There are two different "HotKey" properties that you can set for
buttons.
One is the "mnemonic". The mnemonic is a single character, generally
one that is included in the text of a menu item or button. For regular
buttons and for top level menus, when the user presses the ALT key plus
this character, it will activate the button/menu. For menu items, once
the menu containing it is shown, pressing the mnemonic without the ALT
key will activate the menu item.
The button will be displayed with the first occurrence of the mnemonic
character underlined, assuming that the mnemonic appears in the button
text. You can change which character is underlined by setting the
DisplayedMnemonicIndex property on the button.
The other is the "accelerator", which can be any keystroke, but can
only be applied to a menu item. When you press the accelerator for a
menu item, it will perform the action for the menu item without showing
the menu.
The accelerator keystroke is displayed at the right edge of the menu
item. This displays spells out the keystroke, typically something like
"Ctrl-O" or "Ctrl+Alt-/"
--
Regards,
John McGrath [TeamB]
---------------------------------------------------
Before sending me e-mail, please read:
http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID:
<MPG.17871218f9674a9598b775@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsReferences:
<3d154a49_1@dnews> <MPG.177fe12f8c76a08898b72f@newsgroups.borland.com> <3d1c8507_1@dnews> <MPG.17869b563a8d50a398b76d@newsgroups.borland.com> <3d1d043b_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,886c89ef3ca19b0e X-Google-Attributes: gid1089d0,public X-Google-ArrivalTime: 2002-06-28 22:44:05 PST From: John McGrath [TeamB] <ng-b@JPMcGrath.net> Newsgroups: borland.public.jbuilder.java.api Subject: Re: How to set HotKey in Menu and Button? Date: Sat, 29 Jun 2002 01:39:23 -0400 Message-ID: <MPG.17871218f9674a9598b775@newsgroups.borland.com> References: <3d154a49_1@dnews> <MPG.177fe12f8c76a08898b72f@newsgroups.borland.com> <3d1c8507_1@dnews> <MPG.17869b563a8d50a398b76d@newsgroups.borland.com> <3d1d043b_1@dnews> X-Newsreader: MicroPlanet Gravity v2.60 NNTP-Posting-Host: 209.92.40.60 X-Trace: dnews 1025329160 209.92.40.60 (28 Jun 2002 22:39:20 -0700) Lines: 38 X-Authenticated-User: jpmcgrath Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-05!sn-xit-01!supernews.com!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews