JDK-6184449 : JComboBox responds to Key Events even when it is non-focusable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-10-26
  • Updated: 2010-04-02
  • Resolved: 2005-04-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6 b32Fixed
Related Reports
Relates :  
Relates :  
Description
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

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/swing_data/mustang/6184449.3 ###@###.### 2005-04-11 18:33:42 GMT
05-04-2005

EVALUATION JComboBox is a composite component (assembled from other components) and composite components are plagued with this type of issue. Perhaps we should propogate the setFocusable call to subcomponents of the JComboBox. ###@###.### 10/26/04 16:29 GMT I think, we should manually call setFocusable(false) for the combobox editor and for the combobox button to fix the problem. ###@###.### 2005-04-05 11:38:00 GMT
26-10-2004