label.setText(value.toString());
if (selected)
label.setBackground(UIManager.getColor("Tree.selectionBackground"));
else
label.setBackground(UIManager.getColor("Tree.textBackground"));
TreeCheckingModel checkingModel = ((CheckboxTree) tree).getCheckingModel();
TreePath path = tree.getPathForRow(row);
boolean enabled = checkingModel.isPathEnabled(path);
boolean checked = checkingModel.isPathChecked(path);
button.setEnabled(enabled);
label.setForeground(Color.black);
button.setSelected(checked);
return this;
}