简体   繁体   中英

Creating a checkbox java list

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.

It must have an scrollbar if the content is bigger to the initially set dimensions.

Put the JList inside a JScrollPane .

When checked every node must stay highlighted.

This is going to confuse the user. The check marks are sufficient.

Every node of the list must have a check box object.

You'll have to extend a JList and a ListCellRenderer to gain this functionality. The ListSelectionListener that I have is over 100 lines of code.

You might find an already existing check box JList on the web. I have one in a book.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM