I am using DefaultComboBoxModel to display a list of clients in JComboBox . Currently, the list displays only their name. I would also like to have a link to each client in DefaultComboBoxModel , so that when you select a name, it also contains a link to the object of the real client.
To achieve this, I suspect that I need to extend DefaultComboBoxModel and possibly override the addElement() method? Or can I just add a new method that can also store my client links? If so, do I need to look for the source code for DefaultComboBoxModel to find out how it stores the elements? Sorry if this question is confusing, but I cannot figure out how to do this correctly. Thanks for reading.
java swing
Johan
source share