JDK-4097435 : JFC should provide independent notions of menu shortcuts and hot keys
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.1.4
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: generic
  • Submitted: 1997-12-05
  • Updated: 1998-02-19
  • Resolved: 1998-01-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 swing0.8Fixed
Related Reports
Relates :  
Description
JFC 0.5 classes provide a mechanism that allow the programmers to specify a menu shortcut. This part works well. Pressing a Alt-<menu shortcut> pops a menu.

The problem/bug is that menuitem shortcuts do not works. Using registerKeyboardActions() one can associate a global hotkey that will cause an action.

However, a menu short cut (at least in Motif) should allow the user to press a single letter (specified as the short cut of the menu item) and cause an action.
This functionality is missing (or is buggy).

In Solaris/CDE and using dtterm as an example:

Alt-W pops down a Window menu.
Pressing N (menu short cut for New) causes a New Window action.

This is an essential functionality for shipping JFC-based products that replaces use of Motif.

[gelf 12/5/97]

Menu shortcuts and global menu hotkeys should be independent and follow
the general CUA conventions. A better example would be dtterm's Edit menu.
Edit menu has a shortcut Alt-E (E is underlined) and contains two
items - Copy and Paste. Copy has a shortcut 'C' (C is underlined) and
Paste has a shortcut 'P' (P is underlined). Copy's hotkey is Ctrl-Insert
and Paste's hotkey is Shift-Insert. Hotkeys and shortcuts have different
scope and they act differently. When a user presses Alt-E, the Edit
menu is displayed and the user have access to menu shortcuts 'C' and 'P'
which were not active before. So to copy a selected text into a clipboard
one can press Alt-E and C. Hotkeys, on the other hand, are always active
and when one uses a hotkey the appropriate action is executed without
displaying a menu. Menuitems should support both. Menu shortcuts
should be underlined. Menu labels whould be formatted in such a way
so that all hotkeys of a submenu are left-aligned (bugid: 4096574)

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: swing0.8 INTEGRATED IN: swing0.8 VERIFIED IN: swing1.0fcs
14-06-2004

EVALUATION This is now fixed -- for the next version we offer mnemonics and accelerators. Just so you know, MenuShortcut in 1.1 is the same as accelerator (hot-key). Mnemonics (which are the underlined letter which lets you choose a selection from an open menu) are not available in 1.1, and are only available on Windows (because of an implementation fluke) on 1.02. So the terminology is a little bit different, but the purpose of this bug is covered. *NOTE* that though the accelerators work, the L&Fs have not yet been adjusted to display the text of the keystroke which will activate them. This is coming!
11-06-2004