United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6939261 Since 1.6.0_18 JMenus at JMenuBar are not selectable by their Mnemonic key anymore
JDK-6939261 : Since 1.6.0_18 JMenus at JMenuBar are not selectable by their Mnemonic key anymore

Details
Type:
Bug
Submit Date:
2010-03-30
Status:
Resolved
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2010-09-07
Component:
client-libs
OS:
windows_vista
Sub-Component:
javax.swing
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u18
Fixed Versions:
6u21-rev (b11)

Related Reports
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
Since JRE 1.6.0_18, JMenus at JMenuBar are not selectable by their Mnemonic key anymore.

How to reproduce (Testcase is attached):
OS: Windows Vista
javac MenuDemo.java
java MenuDemo

with JRE 1.6.0_17 (or any earlier version):
Press the Alt-key, the JMenuBar is selected. If you press "e" or "s" (the mnemonik keys for the JMenus), the submenu will be visible to the user. That behavior is also native Windows behavior (Notepad for example).

with JRE 1.6.0_18:
Press the Alt-key, the JMenuBar is selected. If you press "e" or "s" (the menemonik keys for the JMenus), nothing happens.

In both cases (_17 and _18), you can open the submen by entering Alt-e or Alt-s.
The issue can be reproduced on Solaris 10 as well (use the F10 key rather than the Alt-key).

                                    

Comments
EVALUATION

The BasicMenuUI handler must implement the MenuKeyListener for processing of these Mnemonics. However,  the problem of 6827786 stems from double execution of the processing code.
to stop this, I have added a check   to see theere are sub level Jmenus in the currently selected menu ie.e there is a BasicPopupMenuUI instance already running.
so thsi check prevents the double execution that was causing teh inital 6827786 problem..
However, in te case of sub menu the cehck check added for isArmed is very useful to deteremin the opening of another submen u inside an already opened menu.
so a complete fix is to retain that change and restore the Handler but with addition check
                                     
2010-08-12



Hardware and Software, Engineered to Work Together