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 57079 - IDE supports duplicate mnemonics in main menu
Summary: IDE supports duplicate mnemonics in main menu
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jindrich Dinga
URL:
Keywords: A11Y
: 58567 (view as bug list)
Depends on:
Blocks: 55804
  Show dependency tree
 
Reported: 2005-03-29 07:30 UTC by Marian Mirilovic
Modified: 2012-09-27 13:41 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
JFrame with menubar with two items with identical mnemonics (2.80 KB, text/plain)
2005-03-31 09:49 UTC, Marian Mirilovic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marian Mirilovic 2005-03-29 07:30:53 UTC
NB4.1 (200503241924)
Comment 1 Marian Mirilovic 2005-03-29 07:32:17 UTC
Window main menu
Comment 2 Jan Chalupa 2005-03-30 19:38:05 UTC
Jindra, Dusan. Could you please help with resolving this mnemonics conflict? Thanks.
Comment 3 Jindrich Dinga 2005-03-31 07:24:15 UTC
All possible letters, which can be used as a mnemonic for Navigator, have been already used.

First pressing of N letter selects "Navigator", the second selects "Select Documents In". I think the cycle 
is OK. Dusan, what do you think about that?
Comment 4 Milos Kleint 2005-03-31 07:39:40 UTC
sorry, Jindro.
Mnemonic keys don't work like this.
when you press Alt-N, you don't select the item, you choose it. meaning it will
trigger the action. You cannot create cycles for mnemonics. One has to pick a
different one or avoid mnemonics for some items.
Comment 5 Marian Mirilovic 2005-03-31 07:49:10 UTC
I tried to create JFrame with JMenubar with two items with the same mnemonic 
.... and I didn't believe it, it really works.

If you try it and if you press the mnemonic first time it just selects first
menu item, if you press mnemonic second time it selects the second one. To
performance action you have to press Enter !
But if you have two menuitems with different mnemonics and you press one -
action is performed.

I know that in our menubar it works differently, if you press mnemonic action is
performed - so if you have two items with the same mnemonic.

So I think here two questions arises :
1. for HIE : Do we really want to have more than one menuitem with the same
mnemonic in menu ?
2. for DEV: Why it works differently against simple JFrame (described above) ?
Comment 6 Milos Kleint 2005-03-31 07:52:04 UTC
marian, you use 1.5 jdk?
Comment 7 Marian Mirilovic 2005-03-31 07:54:33 UTC
Yes , I am using JDK1.5.0_02 (fcs)  on Linux RH 9/Gnome .
Comment 8 Milos Kleint 2005-03-31 07:58:44 UTC
can you attach the application? I will try on mac+1.4
Comment 9 Jindrich Dinga 2005-03-31 07:59:57 UTC
On Windows XP with JDK 1.5_01 in NetBeans it works for me in same way as marian described. I do not 
have any problems with that.

The problem with mnemonic is, that almost every letter is used, so it is really hard to choose some. I 
think we should discuss it on HIE's meeting.
Comment 10 Jan Chalupa 2005-03-31 08:21:28 UTC
Presumably supported in JDK since 1.4.1. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4515762
Comment 11 Jindrich Dinga 2005-03-31 09:47:10 UTC
According the link, which was posted by Honza, I think we should support it.
Comment 12 Marian Mirilovic 2005-03-31 09:49:27 UTC
Created attachment 21246 [details]
JFrame with menubar with two items with identical mnemonics
Comment 13 Milos Kleint 2005-03-31 11:20:53 UTC
confirmed, seems to work in the swing app on mac as well as described. I was wrong.
Comment 14 Milos Kleint 2005-03-31 12:09:11 UTC
reassigning to dafe, I don't have a working Windows development environment.
Comment 15 Jan Chalupa 2005-04-03 21:34:00 UTC
I've verified that Swing handles duplicate mnemonics fine. After the Window menu
is invoked via Alt-W, the user can cycle the selection between the Navigator and
Select Document in items by pressing the 'N' key.

Up to HIE to define whether duplicate mnemonics are acceptable, or find a new
mnemonics for one of the menu items in question. Until then, there's nothing to
be done from the engineering point of view.
Comment 16 Marian Mirilovic 2005-04-03 21:39:57 UTC
jchalupa wrote :
> I've verified that Swing handles duplicate mnemonics fine. After the Window menu
> is invoked via Alt-W, the user can cycle the selection between the Navigator and
> Select Document in items by pressing the 'N' key.

Honza, 
it doesn't work in NB4.1(200504031800) , JDK1.5.0_02, Linux RH9 / Gnome !
Comment 17 Jan Chalupa 2005-04-03 22:35:47 UTC
Oh, doesn't it? Works for me fine on XP with JDK 1.4.2_06 and 1.5.0_01.

What about the other issue #57080? Does it work on Gnome?
Comment 18 Marian Mirilovic 2005-04-04 07:02:40 UTC
issue 57080 - it works fine (as you described)
Comment 19 Marian Mirilovic 2005-05-04 13:31:16 UTC
*** Issue 58567 has been marked as a duplicate of this issue. ***
Comment 20 Jindrich Dinga 2005-05-05 16:05:31 UTC
I discussed mnemonics duplicating with other HIEs and we all agreed on supporting them so I mark this 
issue as fixed.
Comment 21 Marian Mirilovic 2005-05-11 10:11:15 UTC
verified
Comment 22 zhaoleo 2012-09-27 10:00:28 UTC
i add a mnemonic for two or more menuitems in layer.xml,but the mnemonic will    only work for the last menuitem,it annoys me for long time,pleanse help me!!!
Comment 23 Stanislav Aubrecht 2012-09-27 13:41:41 UTC
(In reply to comment #22)
> i add a mnemonic for two or more menuitems in layer.xml,but the mnemonic will  
>  only work for the last menuitem,it annoys me for long time,pleanse help me!!!

File a new issue then.