G
Guest
I have an editable JComboBox with about 10 values in list.
It is inside JTable like this: (cbMaterials is the JComboBox)
jTable.getColumnModel().getColumn(0).setCellEditor(new
DefaultCellEditor(cbMaterials));
I saw a strange thing that I cannon explain.
We suppose the current value of cbMaterials is "apple"
When I click with the mouse to JComboBox and then immediately click to
another Combonent, JComboBox pass to setValueAt (of MyClassTableModel)
the previous value ("apple").
When I click with the mouse to JComboBox and then WITHOUT changes I
press ENTER, JComboBox pass to setValueAt (of MyClassTableModel) the
value: "".
This not happen always but I dont understand why & when happens (!)
(after a LOT of tests and debugging)
So, I ask: Why?
It is inside JTable like this: (cbMaterials is the JComboBox)
jTable.getColumnModel().getColumn(0).setCellEditor(new
DefaultCellEditor(cbMaterials));
I saw a strange thing that I cannon explain.
We suppose the current value of cbMaterials is "apple"
When I click with the mouse to JComboBox and then immediately click to
another Combonent, JComboBox pass to setValueAt (of MyClassTableModel)
the previous value ("apple").
When I click with the mouse to JComboBox and then WITHOUT changes I
press ENTER, JComboBox pass to setValueAt (of MyClassTableModel) the
value: "".
This not happen always but I dont understand why & when happens (!)
(after a LOT of tests and debugging)
So, I ask: Why?