Article View: borland.public.jbuilder.java.swing
Article #10320Re: key accelerator for JMenu
From: Wendy Lin
Date: Fri, 15 Oct 1999 00:00
Date: Fri, 15 Oct 1999 00:00
90 lines
2923 bytes
2923 bytes
Nick:
What do you mean? Short cut keys property? It is still available if you use
AWT menu items.
In Swing, short cut keys is replaced by accelerators.
--Wendy
JBuilder QA
nick bhanji <nbhanji@home.com> wrote in message
news:7u63ij$82313@forums.borland.com...
> 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:
<7u7iv5$kds20@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7u5ekq$4he4@forums.borland.com> <7u5les$4hi17@forums.borland.com> <7u63ij$82313@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: " Wendy Lin" <wlin@borland.com> Subject: Re: key accelerator for JMenu Date: 1999/10/15 Message-ID: <7u7iv5$kds20@forums.borland.com> X-Deja-AN: 537120301 References: <7u5ekq$4he4@forums.borland.com> <7u5les$4hi17@forums.borland.com> <7u63ij$82313@forums.borland.com> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211 Organization: Borland X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.swing