posted 18 years ago
Hi Serish,
You just need implement the TreeCellRenderer ineterface and provide implementation for the getTreeCellRendererComponent method.
Ex::
MyRenderer implements TreeCellRenderer
{
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean selected, boolean expanded, boolean leaf, int row,boolean hasFocus)
{
If (value is Class)
{
setIcon(Class Icon);
}
else
{
setIcon(Interface Icon);
}
}
}
Then add this render obj to the Jtree.
Cheers,
K r I s H.