How to update 2 JCombo Boxs

前端 未结 2 695
醉梦人生
醉梦人生 2021-01-20 02:41

I have 2 Jcombo Boxs: which is combo1 and combo2

I choose combo1 and I can get information for combo2 but The problem is I can get informatiob for combo2 but it is n

2条回答
  •  旧巷少年郎
    2021-01-20 03:32

    As you do now, you recreate the combo box every time (by returning the tmp in update method). This as it seems is not reflecting in the UI and maybe others will post the reason. But if you can change to update the combo values (changing the model or deleting the current values and adding the new ones) instead of recreating, then the following post can help you Dynamically change JComboBox

提交回复
热议问题