This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 29676

Summary: Mnemonic index logic wrong under JDK 1.4
Product: platform Reporter: Jesse Glick <jglick>
Component: Window SystemAssignee: _ tboudreau <tboudreau>
Status: CLOSED DUPLICATE    
Severity: blocker CC: mihmax
Priority: P3 Keywords: JDK_SPECIFIC
Version: 3.x   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Attachments: Possible patch

Description Jesse Glick 2002-12-20 18:52:50 UTC
Look at the File menu item Save All. Under either
JDK 1.3 or 1.4 it puts the underscore under the
'a' in "Save". This is wrong; the menu item in the
bundle is listed as:

Save &All

Under JDK 1.3, there is nothing to be done. Under
JDK 1.4, however, we can use
setDisplayedMnemonicIndex. The current logic in
Actions is wrong; it calls sDMI only for non-Latin
characters. It should use it for *all* characters.

There are other potential logic errors in this
area (#26678 patch). The logic to catch linkage
errors in Actions14 is wrong; instantiating the
class *will not* generally throw
NoMethodFoundError under JDK 1.3 (depends on VM
validation settings and so on). You need to
actually try calling the method to determine this.
See my comments in #26678.

Also there is weird code that turns off the
mnemonic in case the strings ends with '&' - what
is this for?

Seems to work as desired for me on Linux under JDK
1.3.1_03 and JDK 1.4.1_01. Needs confirmation on
other platforms, and especially in localized (e.g.
Russian) builds.
Comment 1 Jesse Glick 2002-12-20 18:53:54 UTC
Created attachment 8380 [details]
Possible patch
Comment 2 _ mihmax 2002-12-22 10:06:24 UTC
I can confirm that there really was a piece of bad logic: if
non-Russian, do nothing ;-)

No the patch works for me as Jesse desired on Windows, both English
and Russian builds with JDK 1.3.1 and 1.4.1

Verified.

I think I'll commit this fix into 3.4.1 RC2
Comment 3 _ mihmax 2002-12-22 10:07:58 UTC
No the patch works
~~~ sorry, typpo, should be:
Now works
Comment 4 _ mihmax 2003-02-09 20:34:04 UTC
I'm planning to fix this issue as a part of issue 26640 fix, hence I
close this as a dup.

*** This issue has been marked as a duplicate of 26640 ***
Comment 5 Marian Mirilovic 2003-07-22 14:34:43 UTC
verified, closed - it's duplicate.