dcsimg
how to set the Foreground in JTREE
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   kishore_pej
Posted On:   Thursday, March 29, 2001 02:26 PM

how to set the Foreground in JTREE

Re: how to set the Foreground in JTREE

Posted By:   Sandip_Chitale  
Posted On:   Thursday, March 29, 2001 10:15 PM

The tree rows (nodes) are reallyt painted by the TreeCellRenderer
returned component.


Set the foreground of the component returned from the installed
TreeCellRederer's


public Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)

which happens to be JLabel in case of
DefaultTreeCellRenderer.


Also please try to read the class documentations and JFC tutorial at -


http://java.sun.com/docs/books/tutorial/books/swing/

About | Sitemap | Contact