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

Focus/mnemonic problems when JMenuItem has the same mnemonic as its JMenu

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.4.0
    • client-libs
    • None

      Depending on who has the focus, mnemonics are working incorrectly when a JMenu has a JMenuItem with the same mnemonic. Load the attached test program and try the steps below exactly (ie. do not change the focus to the text area when the program first loads).

      First, type 'ALT-t ALT-r'
      Notice that the word "four" appears in the text area to show that three->four was selected.

      Now type 'ALT-i'
      Notice that the word "six" appears in the text area to show that five->six was selected. This is incorrect behaviour. Menu five should have become selected but not menu item six.

      Now type 'ALT-i'
      Nothing happens. Something weird has happened to the focus.

      Now give the focus to the text area by clicking on it.
      Type 'ALT-t ALT-r'.
      "Four" appears as before.

      Now Type 'ALT-i'
      Menu five is selected.

      Type 'ALT-i' again.
      Item five->six gets executed and "six" is printed.

      Type 'ALT-i' again.
      Item five->six gets executed AGAIN and "six" is printed. This is odd because we only typed it once and menu five should have become selected, not item six.

      Type 'ALT-i' again.
      Nothing happens. Something weird has happened to the focus again.

            svioletsunw Scott Violet (Inactive)
            shickeysunw Shannon Hickey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: