954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to get current index in jComboBox?

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

forhacksf
Newbie Poster
9 posts since Mar 2010
Reputation Points: 10
Solved Threads: 1
 

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

JamesCherrill
Posting Genius
Moderator
6,370 posts since Apr 2008
Reputation Points: 2,130
Solved Threads: 1,073
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: