0

How to use getSelectedIndex correctly??

Hi I have got a problem (in Java language). When I use (getSelectedIndex) it only gives me the first thing it mach with . But I want to use that and get Selected Index on repeat . How can I do that.( Sorry for my bad English I'm just a 15 years old Iranian child). Thanks for your help

22nd Jun 2022, 8:40 PM
Amirmohammad Honarvar
4 Answers
0
Hii Well, I don't know java very well, but you should link your code here, so we can see it! Keep on coding :)
22nd Jun 2022, 10:07 PM
Alexandre
Alexandre - avatar
0
choose one: javax.swing.JComboBox.getSelectedIndex() javax.swing.JList.getSelectedIndex() javax.swing.JTabbedPane.getSelectedIndex() javax.swing.SingleSelectionModel.getSelectedIndex() javax.swing.DefaultSingleSelectionModel.getSelectedIndex() java.awt.List.getSelectedindex() java.awt.Choice.getSelectedIndex() org.w3c.dom.html.HTMLSelectElement.getSelectedIndex() javax.security.auth.callback.ConfirmationCallback.getSelectedIndex()
23rd Jun 2022, 4:17 AM
zemiak
0
What do you mean. OK. I choose javax.swing.JComboBox.getSelectedIndex.
23rd Jun 2022, 7:18 AM
Amirmohammad Honarvar
0
javax.swing.JComboBox is for single selection, for multiple selection use JList it is possible solutions like re-implement classes used by JComboBox, but it is much more complicated
23rd Jun 2022, 2:00 PM
zemiak