javax.swing.tree
Interface TreeCellRenderer
- All Known Implementing Classes:
- DefaultTreeCellRenderer
public interface TreeCellRenderer
A TreeCellRenderer is used by the JTree component to
paint individual tree elements (nodes).
getTreeCellRendererComponent
Component getTreeCellRendererComponent(JTree tree,
Object value,
boolean selected,
boolean expanded,
boolean leaf,
int row,
boolean hasFocus)
- Returns a component that has been configured to display one element (or
node) in a
JTree component. The arguments to this method are used
to pass in the value and state of the element to be rendered.
- Parameters:
tree - the tree.value - the value to render.selected - is the tree element selected?expanded - is the tree element expanded?leaf - is the tree element a leaf node?row - the row index.hasFocus - does the tree element have the focus?
- Returns:
- A component that is configured for rendering the tree element.