1 Reply Latest reply: Sep 19, 2012 9:00 AM by StanislavL RSS

    JComboBox selectedIndex and selectItem

      I would just like to know if there is a work-around for this problem.

      According to the javadoc, a JComboBox's getSelectedIndex returns the first item in the list that matches the given item, which is fine if you have unique items in the list. But what if you have the same items in a list, e.g "James", "James" but would like to select them according to their indexes in the list. Changing the index/selecting the item will select the first one, but if i want to select the second one, for any reason? Is there a work-around for this, without having to change the items (the names in my example)?

      Thank you