Link to home
Start Free TrialLog in
Avatar of miteshn
miteshn

asked on

JComboBox after JPanel.repaint

Hi,
I have a JPanel(parent) on which I am GridLayout. In my JPanel, I have two panels(child1,child2) added. Both these panels have a ComboBox. The actionListener causes the bigger panel to be repainted. Now, when if my child1.ComboBox has some item selected, how do I show it in the JComboBox next to the arrow. After a repaint, I am getting  a default value at the combo boxes.



ASKER CERTIFIED SOLUTION
Avatar of Tols
Tols

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of miteshn
miteshn

ASKER

When I do that, it initializes the action listener, and goes into an infinite loop. I want my combo boxes to save their status before a repaint, and show the item last selected.

thanks
Avatar of miteshn

ASKER

i actually figured it out...first, remove the actionListeners, and then setSelectedItem. then add actionListeners again...
Sorry for less of answer. In my country it was deep night. :-)