So far, I’ve tried simply going through my labels and adding each one to the list’s list model with:
listModel.addElement(label);
So this works, but it simply gives a string representation of the label rather than the actual label.
Basically, is it possible to have a JList of JLabels? If not, then what’s a good way to have a scrollable list of JLabels that I can update?
JList,JTable,JComboBox's popupreturn by defaultJLabel / JComponentfrom theRenderer, then there is no reason to put thoseJComponentstypes to theJList(in this case)please read how Renderer to works, JLabel and Icon, examples here and here,
concept of
Renderersis similair forJList,JTable,JComboBox's popup