JDK-4515752 : RFE: ENTER on non-modified editable JComboBox should go to the Default Button
  • Type: Enhancement
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 1.3.1
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2001-10-17
  • Updated: 2014-12-30
  • Resolved: 2002-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.
Other
1.4.1 hopperFixed
Related Reports
Relates :  
Relates :  
Description
According to the Java Look and Feel Design guidelines, Return/Enter is supposed to close a combobox list and commit any change. If the list is already closed, it would be nice if Return/Enter would active the default button on the dialog box.

This makes the most sense for a non-editable combo box. Consideration should also be given for whether this makes sense for an editable combo box (maybe the first return commits any edit, and the second one is passed to the default button/container?)

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: hopper FIXED IN: hopper INTEGRATED IN: hopper
14-06-2004

EVALUATION Most of this has been fixed for merlin and integrated for 1.4 beta2 under bug id 4337071. Specifically, non editable combo boxes will pass throught the ENTER key events to the default button. For editable combo boxes, the ENTER key is not passed to the default button since ENTER is overloaded to commit the edited change. I'll consider the request to pass the ENTER to the default button if changes have not been made in the editable text field. ###@###.### 2001-10-17 The current solution that I'm investigating is to detect the enter action in the ComboBoxEditor (in JComboBox.actionPerformed() and forward a new ActionEvent to the "enterPressed" entry of the JComboBox ActionMap. So far it seems to work correctly - even then editable JComboBox is a table cell editor. Unfortunately, the code looks like a bit of a hack since the BasicComboBoxEditor doesn't know about the JComboBox so the actionPerformed method directly executes the "enterPressed" action - something thats defined in BasicComboBoxUI. One other approach is to register an ActionListener on the editor within BasicComboBoxUI. This seem cleaner since it's now part of the UI implementation. This is the approach that I'm going to take. ###@###.### 2002-04-03
03-04-2002