-
Bug
-
Resolution: Fixed
-
P3
-
7u21
-
b08
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8045573 | 8u25 | Anton Litvinov | P3 | Resolved | Fixed | b01 |
JDK-8038194 | 8u20 | Alexey Ivanov | P3 | Resolved | Fixed | b09 |
JDK-8053801 | emb-8u26 | Anton Litvinov | P3 | Resolved | Fixed | b17 |
JDK-8038196 | 7u80 | Alexey Ivanov | P3 | Resolved | Fixed | b01 |
JDK-8060980 | 7u79 | Anton Litvinov | P3 | Resolved | Fixed | b01 |
JDK-8057450 | 7u76 | Anton Litvinov | P3 | Resolved | Fixed | b01 |
JDK-8050346 | 7u75 | Anton Litvinov | P3 | Resolved | Fixed | b01 |
JDK-8044713 | 7u72 | Anton Litvinov | P3 | Closed | Fixed | b01 |
Problem with Java version 7u21.
Run the following test app, which uses standard DefaultCellEditors in a
simple JTable.
With the mouse: click in the cells of the first two columns.
- Notice from the console output that the cell editor components gain focus
(the caret is also visible) - The user can simply type in the new values.
- The user can interact with the editor just as if they they are using a
regular component.
Now try with the keyboard: navigate to a cell. Start typing a new value.
- The editor appears
- The editor is not given focus and no caret is visible. The focus is still
on the table!
- When typing regular letters the value in the editor is updated, but only
for the text field and not with the combo.
- The combo's drop arrow is visible, but it cannot be dropped.
Test case:
import java.awt.FlowLayout;
import java.awt.event.FocusAdapter;
import java.awt.event.FocusEvent;
import javax.swing.DefaultCellEditor;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.JTextField;
public class ComboInTable {
public static void main(String[] args) {
JFrame f = new JFrame();
f.setSize(300, 200);
f.setLocationRelativeTo(null);
f.setLayout(new FlowLayout());
f.add(createTable());
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.setVisible(true);
}
private static JTable createTable() {
JTable table = new JTable(new String[][]{{"One", "Red"},
{"Two", "Green"},
{"Three", "Yellow"}},
new String[]{"#", "Colour"});
JTextField tf = new JTextField();
DefaultCellEditor tfEditor = new DefaultCellEditor(tf);
tfEditor.setClickCountToStart(1);
JComboBox combo = new JComboBox(new String[]{"Red", "Green", "Blue",
"Yellow"});
combo.setEditable(true);
DefaultCellEditor comboEditor = new DefaultCellEditor(combo);
comboEditor.setClickCountToStart(1);
table.getColumnModel().getColumn(0).setCellEditor(tfEditor);
table.getColumnModel().getColumn(1).setCellEditor(comboEditor);
FocusL focusL = new FocusL();
table.addFocusListener(focusL);
tf.addFocusListener(focusL);
combo.addFocusListener(focusL);
combo.getEditor().getEditorComponent().addFocusListener(focusL);
return table;
}
private static class FocusL extends FocusAdapter {
public void focusLost(FocusEvent e) {
System.out.println("Focus Lost: " +
e.getSource().getClass().getName());
}
public void focusGained(FocusEvent e) {
System.out.println("Focus Gained: " +
e.getSource().getClass().getName());
}
}
}
- backported by
-
JDK-8038194 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8038196 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8045573 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8050346 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8053801 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8057450 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8060980 Editable combos in table do not behave as expected
-
- Resolved
-
-
JDK-8044713 Editable combos in table do not behave as expected
-
- Closed
-
- duplicates
-
JDK-8032938 Combo editor swallows the first key press
-
- Closed
-
- relates to
-
JDK-8078855 [TEST_BUG] javax/swing/JComboBox/8032878/bug8032878.java fails in WindowsClassicLookAndFeel
-
- Resolved
-
-
JDK-8057766 No CCC for JComboBox.processKeyBinding
-
- Closed
-
-
JDK-8068047 JTable - JComboBox edit problem
-
- Closed
-
-
JDK-8243282 Enter some text and click into another cell,it reverts to the old, unedited text
-
- Closed
-
-
JDK-8058525 Editable ComboBox in JTable does not get edited text as selected item
-
- Closed
-