🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #10318

Re: key accelerator for JMenu

#10318
From: nick bhanji
Date: Thu, 14 Oct 1999 00:00
75 lines
2449 bytes
 Thank you Wendy.

Just to let you know - this feature was available in Jbuilder2 Professional
and Jbuilder2 Client/Server.

thanks again.

nick.b

Wendy Lin wrote in message <7u5les$4hi17@forums.borland.com>...
>Short Cut Key is only for AWT menu items.
>
>In Swing's JMenuItem you'll need to write a little bit of code for
>accelerators.
>
>Example:
>
>JMenutItem aboutMenuItem = new JMenuItem("About");
>aboutMenuItem.setAccelerator(KeyStroke.getKeyStroke('A',
>java.awt.Event.SHIFT_MASK, false));
>
>This sets the accelerator to shift-A.
>
>Another way to do a short cut is to use menomic property:
>
>JMenutItem aboutMenuItem = new JMenuItem("About");
>aboutMenuItem.setMnemonic('A');
>
>This underlines A, I guess it is also refer to as Hot Key.
>
>Hope this helps.
>
>--Wendy
>JBuilder QA
>
>
>nick bhanji <nbhanji@home.com> wrote in message
>news:7u5ekq$4he4@forums.borland.com...
>> Hi,
>>
>> I am trying to use Key accelarator for menu items.  When I select
>> Accelarator in the menuitem properties
>> it comes up <none>.  I looked up in the help file which comes up as
>follows:
>>
>> "
>> Specifying keyboard shortcuts
>>
>> Keyboard shortcuts enable the user to perform a menu action by typing in
a
>> shortcut key combination. For example, a
>> commonly used shortcut for File|Save is Ctrl+S.
>>
>> To specify a keyboard shortcut for a menu item,
>>
>> Select the menu item in the menu designer or in the component tree.
>> In the Inspector, select the shortcut property and enter a value or
choose
>a
>> key combination from the drop-down list.
>> This list is only a subset of the valid combinations you can use.
>>
>> When you add a shortcut, it appears next to the menu item at runtime.
>> "
>>
>> Can some one please check to make sure I am not the only one having the
>> problem.
>>
>> Thanks in Advance
>> nick.b
>>
>>
>>
>
>
Technical Details
Message-ID: <7u63ij$82313@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7u5ekq$4he4@forums.borland.com> <7u5les$4hi17@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,df80e8f377c66df7
X-Google-Attributes: gid111d45,public
From: "nick bhanji" <nbhanji@home.com>
Subject: Re: key accelerator for JMenu
Date: 1999/10/14
Message-ID: <7u63ij$82313@forums.borland.com>
X-Deja-AN: 536910247
References: <7u5ekq$4he4@forums.borland.com> <7u5les$4hi17@forums.borland.com>
Organization: Another Netscape Collabra Server User
X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3
Newsgroups: borland.public.jbuilder.java.swing