JDK-6550847 : Action events not firing in JCombox's selected item
  • Type: Bug
  • Component: client-libs
  • Sub-Component: javax.swing
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2007-04-26
  • Updated: 2011-01-19
  • Resolved: 2009-05-18
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 JDK 7
6u14 b04Fixed 7Resolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
FULL PRODUCT VERSION :
java version "1.5.0_11"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03)
Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
I recently updated to version 1.6 of the JRE.  I have several applications build using Netbeans 5.5 and compiled using java version 1.5.0.   After upgrading to version 1.6 The action events for JComboBox, JTextField and JButton do not fire.  These are the only action events I tested so there may be others as well that do not respond to a mouse click or pressing the "Enter" Key.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Install java jre version 1.6 then execute an application build using Swing components that have action events associated with them and compiled using java jdk 1.5.  Select an item from a JComboBox, click on a JButton or press the enter key when the cursor is in a JTextField.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I expected the application to work just like it did using jre version 1.5.  All events should have fired and executed the event handlers attached to the above described objects.
ACTUAL -
None of the action events fired or executed the event handler code assigned to the objects in question.

REPRODUCIBILITY :
This bug can be reproduced always.

Release Regression From : 5.0u11
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

Comments
EVALUATION I forgot to mention that this is a regression for the CR 4765319
13-03-2009

EVALUATION Here is the complete discussion about this bug: http://forums.java.net/jive/thread.jspa?messageID=336723
13-03-2009

EVALUATION Here is the test case, tab the first cell, press F2 followed by Enter and see the editor is still there when is should be hidden import javax.swing.Box; import javax.swing.DefaultCellEditor; import javax.swing.JComboBox; import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JScrollPane; import javax.swing.JTable; import javax.swing.SwingUtilities; import javax.swing.table.DefaultTableModel; public class TableComboEditor { private JComponent createContent() { Object[] data = new Object[] { "somestuff" , "otherstuff", "haha... "}; DefaultTableModel model = new DefaultTableModel(10, data.length); model.insertRow(0, data); JTable table = new JTable(model); JComboBox box = new JComboBox(new Object[] {"one", "two", "three"}); table.setDefaultEditor(Object.class, new DefaultCellEditor(box)); JComponent content = Box.createHorizontalBox(); content.add(new JScrollPane(table)); return content; } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame("TableComboEditor"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new TableComboEditor().createContent()); frame.pack(); frame.setVisible(true); } }); } }
11-03-2009

EVALUATION The only difference between JDK 1.5 and JDK 1.6 is that JDK 1.6 doesn't generate actionEvent if a user selects the value in combobox's popup which was already selected Run the provided example with JDK 1.5 Have a look to the "Select Leader Material" combobox, Note the "Fluorocarbon" value is selected; Open this combobox with the mouse and select the same "Fluorocarbon" value; Notice that the "Calculate" button becomes enabled Run the provided example with JDK 1.6 Follow the same instructions and Notice that the "Calculate" button doesn't become enabled But any new value in the combobox will enable it No any other differnces were found Decision: JDK 1.5 erroneously fires an action if you select the same value in combobox in JDK 1.6 this bug was fixed, action fires only if you select a *new* value This CR is not a bug and will be closed It may be reopened if any new comments/test cases are provided
02-07-2007

EVALUATION Hmmm...broken ActionEvents in 6.0 would be a serious issue indeed. But I would expect most Swing applications to be broken and this is the first I've heard. Would be good to get a test case from the submitter.
29-06-2007