I have a problem with the getItemSelected() method. Here is the description
of the problem:

I have a JComboBox component that contains custom objects, say of type
ObjectX

ObjectX defines the toString() method that returns the Name to be displayed
in the combo box. 

I add items to the combo box by adding them to the model:

  model.add(item);

And then setting model on the combo box

  comboBox.setModel(model);

When I call getItemSelected() the first time, it returns back the object of
type ObjectX, which is what I expect. However, as soon as I select some
other item in the combo box/change the selection, it begins returning the
object of type String, which is not correct. Does anyone know why? How can
fix it?

Thanks in advance.
> _____________________________________________
> Lenny Reinstein
Firmwide Internet Group 
Goldman, Sachs & Co.
> Tel: (212) 855-0332
> Email: [EMAIL PROTECTED] 
> 
> 
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to