populate multiple combobox with same model but select diff
问题 Having problems with the ComboBox , I have populated multiple ComboBox es with the same model, but when I run my program and select a value from one ComboBox it selects the same value for the rest. ComboHBoy.setModel(defaultComboBoxModel); ComboHGirl.setModel(defaultComboBoxModel); ComboDHBoy.setModel(defaultComboBoxModel); ComboDHGirl.setModel(defaultComboBoxModel); 回答1: That's because they all are referenced to the same model , any change of the model will affect the all the other combos.