javax.swing.tree
public interface TreeCellRenderer
TreeCellRenderer
is used by the JTree
component to
paint individual tree elements (nodes).Modifier and Type | Method and Description |
---|---|
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. |
Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
JTree
component. The arguments to this method are used
to pass in the value and state of the element to be rendered.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?