Hi,
 
The way I do it is to set the preferredsize of the TreeCellRenderer for each cell it is rendering.
e.g. in my application I have to show a node with text and arbitrary amount of detail below it.
So, I have a JPanel with a JLabel and a JTextArea in a BorderLayout as my TreeCellRenderer.
For each getTreeCellRendererComponent, I set the data and call doLayout and return the JPanel.
The JTree takes care of the rest.
 
Hope this helps.
 
Best Regards
Sachin
----- Original Message -----
From: a johnston
Sent: Thursday, September 19, 2002 3:20 AM
Subject: Set different node's height in JTree

Hi All,

Does anyone know how to set a node's height in JTree according to their row number? This is a feature I am trying to use for highlighting purposes.  I have searched almost all the relevant websites, but no success in finding a solution. Thanks in advance for any reply.

PS. Normally all the nodes in a JTree have to same height.

Best regards,

George Song



Do you Yahoo!?
Yahoo! News - Today's headlines

Reply via email to