This post does not contain self written source code for adding checkboxes as nodes to a JTree but there is already a set of written codes spread for everyone’s use. Just look up Google using CheckBoxNodeEditor and you can easily find them.
The source codes are there ready for use and there is also a sample application written to get you started. Thank you to the person who made this. At least there is no more need to write your own cell editor and cell renderer from scratch. I was even able to use the same codes to add a JButton instead of a JCheckBox.
Pretty useful set of codes.