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

menu mnemonics should be separate from menu accelators.

XMLWordPrintable


      Consider the following code fragment:

      JMenuItem addMenuItem = new JMenuItem("Add");
      addMenuItem.setMnemonis(KeyEvent.VK_A);
      addMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT,
                                                        Event.ALT_MASK));

      editMenu.add(addMenuItem);

      The intent here is that A is the mnemonic, while Alt+Insert is the
      menu accelator. Thus in the menu, A (of Add) should be underlined and
      the menu item should look like "A_dd Alt+Insert".

      The bug is that A of Alt also gets underlined. That is the menu item
      looks like "A_dd A_lt+Insert"

      This is causing confusion for the application users.

            gsaab Georges Saab
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: