Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Editable JComboBox

Thread Tools

Editable JComboBox

Posts: n/a
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

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?
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
JComboBox: setting the editable text Ben Phillips Java 8 10-09-2008 07:58 AM
using editable jcombobox Jacques Chaurette Java 7 09-06-2007 07:12 AM
How to change the editable JComboBox's model when starting or ending typed @CL Java 1 11-23-2006 09:14 AM
Editable JComboBox problems Allen Java 0 10-16-2006 01:06 AM
How do I make an Editable JCombobox within a Table Model? KLD Java 3 02-15-2004 03:29 AM