i am trying to generate a checkbox list feeded by some records from a database just like the image (JAVA Swing), initially i tried with several chexkboxes but it didn’t work, now i am trying with a multiple selection list but it didn’t work as well and none of the answered questions here looks like to solve the specific needs i have.
Specifications:
- Multiple selection list.
- Every node of the list must have a checkbox object.
- When checked every node must stay highlighted.
- It must have an scrollbar if the content is bigger to the initially setted dimentions.
Put the
JListinside aJScrollPane.This is going to confuse the user. The check marks are sufficient.
You’ll have to extend a
JListand aListCellRendererto gain this functionality. TheListSelectionListenerthat I have is over 100 lines of code.You might find an already existing check box
JListon the web. I have one in a book.