1

My objective is to build a check box node tree with the following features .

Nodes : There will be 2 types of nodes all over the tree .

1 . Parent Nodes

2 . Child Nodes

All the nodes are check box nodes . The parent nodes need to have an additional folder like icon , in addition to the check box.

And all the check boxes must be editable More than one check box must be checkable at a time .

What is the best possible approach that i can take ?

Achilles
  • 1,065
  • 2
  • 13
  • 29
  • possible duplicate of [JTree with checkboxes](http://stackoverflow.com/questions/1223188/jtree-with-checkboxes) – trashgod Feb 01 '12 at 04:40

2 Answers2

1

Looks similar to this Stack Overflow result: JTree with checkboxes

Which refers to this example: http://www.java2s.com/Code/Java/Swing-JFC/CheckBoxNodeTreeSample.htm

In this latter example, change nonLeafRenderer to return your new component (a folder with a checkbox, possibly in a JPanel.)

Community
  • 1
  • 1
Sam Reid
  • 101
  • 1
  • 7
1

If you want a ready to go component you can use CheckBoxTree from Jide-oss.

tenorsax
  • 21,123
  • 9
  • 60
  • 107