This content has been marked as final. Show 2 replies
In JComboBox maintenance a listen list to handle the event Item change event'itemStateChanged(ItemEvent e) is invoked when an item has been selected or deselected by the user.'
also in model(AbstractListModel) maintenance another listen list to handle List Data change event.If you mean ListDataEvent, it is invoked when the application changes the contents of the list.
See these two is duplicated.No they aren't. They are different things.
You can see JList, JTree other components all is only maintenance one list in model.That's not true. JTree has a TreeModel that has a TreeModelListener, and JList has a ListModel that has a ListDataListener.
I think you mean "maintains" instead of "maintenance".
As for an explanation, it was designed that way and that's the way it is now.
For JComboBox, the selection model was made to extend the data model (ComboBoxModel extends ListModel, maybe because the selected data might not be in the data model)
For JTree, the data model (TreeModel) and selection model (TreeSelectionModel) are separated.