I used DefaultTreeCellRenderer which is not allowint to check ,uncheck.
Class EmployeeData
{
init()
{
//Show Jtree
Jtree.setCellRenderer(new CheckBoxRen());
}
}
Class CheckBoxRen extends DefaultTreeCellRendere
{
private JCheckBox checkBox = null;
public CheckboxRenderer() {
}
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
if ((value != null) && (value instanceof DefaultMutableTreeNode)) {
checkBox.setSelected(true);
}
return checkBox;
}
}
not able to check and uncheck checkbox.