is it possible to let jComboBox display the object's string field in th DefaultComboBoxModel Vector
Joined: Mar 01, 2005
is it possible to let jComboBox display the object's string field(without Override object class's toString() method)
of th DefaultComboBoxModel Vector.
if writing my own dataModel a good solution? because there are more than one combobox in the panel, is it need to implements all the combox datamodel? or only one model are enough?
thanks in advance.
Joined: Feb 23, 2007
I'm not sure that I understand your question here. Could you clarify it a bit? One thing I do notice is that the combo box's text makes sense only when we uncomment the toString() method in your City class, and this is expected behavior.
for those without NetBeans, here's his code cleaned of NetBeans-generated code: