TreeCellRenderer is a Java Swing interface that defines the method required by any object that would like to be a renderer for cells in a JTable.
TreeCellRenderer is a Java Swing interface that defines the method required by any object that would like to be a renderer for cells in a JTable
.
The interface defines only one method, getTreeCellRendererComponent
, that takes the value to be rendered and various additional information (selected, focused, is a leaf, etc). The method must return an instance of Component that is positioned at the tree cell location, later calling paint() on it. It is not uncommon to derive the renderer itself from a component and return this
.