JTree with checkboxes
Hi!
I have made a my own tree by extending JTree.
Now I want to add checkboxes on every node.
I have found some examples on the net, but they are all to much...
I just want a class that I can send my tree in to and get a tree with checkboxes out.
Anyone who has one of those... ;)
Thanks!
[331 byte] By [
rejeepa] at [2007-11-27 1:35:43]

# 1
There are no shortcuts.
You have to use a custom renderer to display the checkbox, mouse listener to handle the user clicks on the checkbox, and a custom model to store the check box state.
Reading the tutorial would be a good starting point:
http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#display