Editable JComboBox

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top