Duplicate Values in the Combo box

Hello All,

I am facing one problem with JComboBox and request some one to suggest me the solution. The problem is i am having a combobox which has duplicate values. When i try to pass through these values using down-stroke key , if it encounters duplicate value it is not passing through it (neither forward nor backward). I am struck with this problem. I need duplicate values in the combo box and also should write ItemStateChange Listener for this combo box.

Please suggest me the solution.

Thanks in advance...................................

[572 byte] By [sureshsarmaa] at [2007-11-27 4:31:19]
# 1

The problem is combo box selects by equals.

It means if you have two equal strings and call setSelectedItem() pasing the string the first item will be selected.

To solve this I created a subclass which encapsulates a String but returns true in the equals method only if strings== (not equals).

toString() method was overridden to return the String field value.

Regards,

Stas

StanislavLa at 2007-7-12 9:40:45 > top of Java-index,Desktop,Core GUI APIs...