Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4407119

Sub-Menu opens when mnemonic for parent Menu is typed

XMLWordPrintable


      Problem scenario: When using keyboard menmonic's it's possible to set up the same mnemonic for a submenu (JMenuItem) as the one used by the parent menu (JMenu). Normally typing ALT + the mnemonic key when all of the menus' are closed will just open the corresponing menu. But occasionally the sub menu with the same mnemonic opens as well.
      For example, A menu called 'AMenu' has the mnemonic 'a' and one of it's sub-menu's is called 'ASubMenuitem' and has the mnemonic 'a'. Sometimes, when opening 'AMenu' by typing ALt-'a' both 'AMenu' and 'ASubMenuitem' will open. This is very intermittant particularly on Solaris. It is easier to reproduce on Windows NT 4.0

      The attached test case is a simple JFrame with a JTextArea and a menu. The menu has Sub-Menus. The steps to reprodcuing this are as follows:

      User: presses Alt a.
      Result: (this is ok)

      User: clicks with mouse into textArea.
      Result: (this is ok)
      ____________________________________________________________

      User: presses Alt a. again
      Result: (this is ok)

      User : clicks with mouse into textArea.
      Result: (this is ok)
      ____________________________________________________________

      User: presses Alt a. again
      Result: (this is the problem)

      The sub menu item (Asubmenu) is invoked instead of the main menu (Amainmenu)

      (If you don't get this result, please try again the step1 'presses Alt a'
      and step2 'click with mouse into textArea'.

            svioletsunw Scott Violet (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: