Hi,
i used labes in tree. Please check it and give reply.
Here i used three labels i need tooltip for "lab2". How can i get it?
tree.setCellRenderer(new DefaultTreeCellRenderer()
{
public Component getTreeCellRendererComponent(JTree tree, Object value,
boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
{
if(leaf && !territories.containsKey(value.toString()) && !value.toString().equals(root.toString()))
{
TreeNode chaild = (TreeNode)value;
TreeNode parent = chaild.getParent();
int ind = parent.getIndex(chaild) + 1;
String status = accountStatus[root.getIndex(parent)].get(value.toString());
String val = value.toString();
JLabel label = new JLabel();
exactly(label, 530, 25);
label.setLayout(new FlowLayout());
JLabel lab1 = new JLabel("#"+ind);
exactly(lab1, 50 ,25);
label.add(lab1);
JLabel lab2 = new JLabel(""+val);
exactly(lab2, 300, 25);
label.add(lab2);
JLabel lab3 = new JLabel(""+status);
exactly(lab3, 150, 25);
label.add(lab3);
return label;
}
else
return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
}
});
Thanks,
Kiran
> Thanks CeciNEstPasUnProgrammeur ,
> I clarify my doubt. Applet can accept tooltips .
Yes.
> But i my program didn't get it.
I suppose.
> used trees , there are i added tool tips . They
> didn't work.
Did you notice how you didn't mention that at all in the beginning? See Phil's advise.