Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 1.7 KB

README.md

File metadata and controls

27 lines (20 loc) · 1.7 KB

Swing Checkbox Tree

A check box tree package based on John Zukowski's CheckBox Node Tree Sample code.

You can mix and match DefaultMutableTreeNode and CheckBoxNodeData node types. It also allows check box nodes as non-leaf nodes.

It uses a JCheckBox + JLabel in a JPanel to differentiate between clicking on a check box (to check/uncheck a node) versus a label (to select a node).

The latter example also has code for recursively toggling subtrees in response to boxes being checked or unchecked (see the treeNodesChanged method).

See also this question on StackOverflow.