javax.swing.tree

Interface TreeCellRenderer

public interface TreeCellRenderer

A TreeCellRenderer is used by the {@link JTree} component to paint individual tree elements (nodes).
Method Summary
ComponentgetTreeCellRendererComponent(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 {@link JTree} component.

Method Detail

getTreeCellRendererComponent

public 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 {@link 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.