Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted
Updated 1-Nov-15 23:19pm
v2

1 solution

 
Share this answer
 
Comments
Sarita S 2-Nov-15 4:41am    
I used DefaultTreeCellRenderer.But i dont allow check and uncheck
Richard MacCutchan 2-Nov-15 4:58am    
That makes no sense when takjen with your question. Please edit your question and explain exactly what you are trying to achieve and what errors you see.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900