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

JComboBox responds to Key Events even when it is non-focusable

XMLWordPrintable

    • b32
    • generic
    • generic
    • Verified

      I have a JFrame with an editable JComboBox and a button. I am calling setFocusable(false) on button as well as JComboBox before showing the frame on the screen. When the frame appears, I am clicking on the JComboBox and typing some text. I am surprised to see all the text being shown there and using the arrow keys I am able to select the items in the drop-down. This is incorrect. When JComboBox is non-focusable it should not respond to any keyevents. This works as expected when editability is turned off programmatically (setEditable(false)).

      This is noticed on all platforms since 1.4. I have attached a sample test. Execute the test. You would see a frame with a JComboBox. Try typing some text in the combo box. If the text appears there, the bug is reproduced.
      ###@###.### 10/26/04 10:16 GMT

            draskinsunw Daniel Raskin (Inactive)
            pmohansunw Praveen Mohan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: