I need to add checkboxes to a JTree. A custom TreeCellRenderer/TreeCellEditor seems like the right approach. So far I used the CheckBoxNodeRenderer approach in this webpage. It works OK except for two things:
is there a way to do these things? I looked around for JTrees with checkboxes, can't find much. JIDE looks good but I need to use free open-source software (GPL is not ok, LGPL is ok) in this case. (or create my own checkbox tree)
I know this question has been answered already, but i just want to clear some points:
1) JIDE Common Layer is dual-licensed (GPL with classpath exception and free commercial license). This means that you can use the Common Layer Project without any licensing issues. Please check the following link to confirm: http://www.jidesoft.com/products/oss.htm. The Common Layer includes an implementation of a checkable JTree (com.jidesoft.swing.CheckBoxTree).
2) There's a blog dated from 2005 from the Master himself, Santhosh Kumar, where he explains how to implement a JTree with checkboxes with the requirements you mentioned: http://www.jroller.com/santhosh/entry/jtree_with_checkboxes. It's worth reading it, in my opinion.