how to control a combo box by using another combo box swing

后端 未结 2 1202
陌清茗
陌清茗 2020-12-03 23:43

I have two combo box the items first one is (women and men).I want when user select women in first combo box the list of women\'s dress will appear in second combo box and w

2条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 00:16

    You have to add event listener to the first combobox. This way you will know when its selection changes, you can interrogate it and fill your second combobox out with appropriate data.

    More information is at http://docs.oracle.com/javase/tutorial/uiswing/components/combobox.html#listeners

提交回复
热议问题