United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6827786 Mnemonic cycling for multiple equal mnemonic armed menu items stops when encountering a submenu
JDK-6827786 : Mnemonic cycling for multiple equal mnemonic armed menu items stops when encountering a submenu

Details
Type:
Bug
Submit Date:
2009-04-08
Status:
Resolved
Updated Date:
2011-03-14
Project Name:
JDK
Resolved Date:
2009-10-14
Component:
client-libs
OS:
linux_ubuntu,generic
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u7,6u12,6u15
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
We have seen an unexpected behavior with a Swing GUI.

When there are multiple menu items with the same mnemonic, the user can press the mnemonic key repeatedly to cycle through these items. However, if one of those items is a submenu, once that menu becomes armed, the cycling stops - pressing the mnemonic key again does not move to the next command. This breaks accessibility of software, as users cannot use mnemnoics to access menu items below the submenu.

The issue is OS independent, it occurs on Windows, Linux, Solaris and even Mac OS X.
The customer uses Java 6u7, but it is also reproducible with Java 6u12 and 5u18 for example.

A testcase is available, it is attached to this report (MenuDemo.tar).

Extract the tarball and simply run

$ java -cp . MenuDemo
(the bytecode has been complied with JDK 5u18, source code is in the same folder)

Click on one of the menus and press "j" repeatedly.
In the first menu, the armed item cycles. In the second menu it gets stuck on the submenu.

                                    

Comments
EVALUATION

It seems a key press gets processed twice. First, BasicMenuKeyListener.menuKeyPressed() properly selects the next item with the corresponding mnemonic. Second, BasicMenuUI.Handler.menuKeyTyped() opens a submenu that has that same mnemonic.

The code in BasicMenuUI.Handler.menuKeyTyped() duplicates BasicMenuKeyListener.menuKeyTyped() and should be removed.
                                     
2009-09-09



Hardware and Software, Engineered to Work Together