0

I need a little help please,here is my question:
How can I get the current index in a jComboBox?

I searched it on google and i cant seem to find any answer.
I need to get the index of the item that I select from a Combobox.

Please help

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by JamesCherrill
0

Rather than Google, you first point of reference should be the JComboBox API documentation, where you will find the following...

public int getSelectedIndex() ... Returns an integer specifying the currently selected list item, where 0 specifies the first item in the list; or -1 if no item is selected or if the currently selected item is not in the list

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.