public void setNodeState(Tree tree, CheckedTreeNode node, boolean checked) {
    changeNodeState(node, checked);
    adjustParentsAndChildren(node, checked);
    tree.repaint();

    // notify model listeners about model change
    final TreeModel model = tree.getModel();
    model.valueForPathChanged(new TreePath(node.getPath()), node.getUserObject());
  }
public void setNodeState(Tree tree, CheckedTreeNode node, boolean checked)