Reputation: 125
I made a small program in wich when I select the one of the items in the combobox an image will appeare on the jlabel 1 on the right. there are 2 JRadioButtons on the buttom of the JFrame and when i click one of the radiobuttons it will display the value of the image on jlabel 2.
when the second radiobutton is clicked, it will display another value about the image on the jlabel 3 . but the problem is when I select the second item in the combobox it will still display the old value of firts item on jlabel 2 and 3 .
the question is how can I make it come to the default value automatically ( example: 0; ) when i select second item in the combobox.
thanks.
Upvotes: 0
Views: 236
Reputation: 43504
You could reset the selection item using combobox.setSelectedIndex(0)
.
Upvotes: 2