You need to make a java list containing JPanel
panels, which include an image, text and checkbox.
Like this, only under each need checkboxes.
I tried this:
public static JList<JPanel> itemsArray; public static DefaultListModel<JPanel> listModel;
But after adding, it’s not a socket that is added, but a debug presentation (I don’t know how to call it exactly) So here’s:
For each item, I want to use a separate ItemComponent
class ItemComponent
The number of elements may be unlimited and not known in advance. Plus they should be added dynamically.
JScrollPane
in theJScrollPane
. - zRrrListCellRenderer
, which will have the necessary components in the correct position, the problem is that the elements of theJList
are images, not full-fledged components, as for example. in Android, i.e. You can add a button or checkbox to the renderer, but by themselves they will not be pressed, spawn events, etc. Therefore, they use eitherJTable
withTableCellRenderer
andTableCellEditor
, or their own panel, on which the components are laid out, as desired. - zRrr