In Java Swing, the best way for JList and JComboBox synchronize in terms of data, i.e. have the same list of items at any given time? Basically, if I add elements (or delete elements) one, the other should reflect this change automatically.
I tried to do the following, but it does not work:
JList list = new JList(); JComboBox comboBox = new JComboBox(); DefaultListModel listModel = new DefaultListModel();
java swing jcombobox jlist
Vicky chijwani
source share