JDK-6939261 : Since 1.6.0_18 JMenus at JMenuBar are not selectable by their Mnemonic key anymore
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6u18
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2010-03-30
  • Updated: 2011-02-16
  • Resolved: 2010-09-07
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.
JDK 6 JDK 7
6u21-rev b11Fixed 7Fixed
Related Reports
Relates :  
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
12-08-2010