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

Focus issue with pull down and pop up menus

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Verified

      Description

      JPopup and JMenu* do not work properly with the keyboard.
        JPopup does not work with the keyboard (arrow keys, enter key, etc.). We had to implement a work around in a derived class.
      Enter key is not always processed by JMenu.
        We have cases where we are doing the following on an instance of JPanel:
          // Add the search action to the action map for the filter panel.
          // This will effectively make the search button behave as the default button.
          KeyStroke enterKS = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0);
          getInputMap(WHEN_ANCESTOR_OF_FOCUSED_COMPONENT).put(enterKS, searchAction);
          getActionMap().put(searchAction, searchAction);
        If we go to the menu from this panel and press enter on a menu item the searchAction is performed rather than the selecting the current item in the menu.

          Attached is an example which demonstrates the problems. The header
      comment in the source file reviews the specific problems.

        Attachments

          Activity

            People

            • Assignee:
              mdavidsosunw Mark Davidson (Inactive)
              Reporter:
              mimiali Mir Ali (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: