public static interface HtmlRenderer.Renderer extends TableCellRenderer, TreeCellRenderer, ListCellRenderer
Modifier and Type | Method and Description |
---|---|
void |
reset()
Clear any stale data from previous use by other components,
clearing the icon, text, disabled state and other customizations, returning the component
to its initialized state.
|
void |
setCentered(boolean centered)
Indicate that the text should be painted centered below the icon.
|
void |
setHtml(boolean val)
Explicitly tell the renderer it is going to receive HTML markup, or it is not.
|
void |
setIcon(Icon icon)
Set the icon to be used for painting
|
void |
setIconTextGap(int gap)
Convenience method to set the gap between the icon and text.
|
void |
setIndent(int pixels)
Set a number of pixels the icon and text should be indented.
|
void |
setParentFocused(boolean parentFocused)
Indicate that the component being rendered has keyboard focus.
|
void |
setRenderStyle(int style)
Set the rendering style - this can be JLabel-style truncated-with-ellipsis (...) text, or clipped text.
|
void |
setText(String txt)
Set the text to be displayed.
|
getTableCellRendererComponent
getTreeCellRendererComponent
getListCellRendererComponent
void setParentFocused(boolean parentFocused)
parentFocused
- Whether or not the focused selection color should be usedvoid setCentered(boolean centered)
centered
- Whether or not centered painting should be used.void setIndent(int pixels)
setCentered(true)
has been called.pixels
- The number of pixels to indentvoid setHtml(boolean val)
val
- void setRenderStyle(int style)
HtmlRenderer.STYLE_CLIP
.style
- The text stylevoid setIcon(Icon icon)
icon
- An icon or nullvoid reset()
HtmlRenderer.createLabel()
is called.
Users of the static HtmlRenderer.createLabel()
method may want to call this method if they
use the returned instance more than once without again calling HtmlRenderer.createLabel()
.
void setText(String txt)
HtmlRenderer.Renderer.setHtml(boolean)
if the text is known to either be or not be HTML markup.txt
- The text that should be displayedvoid setIconTextGap(int gap)
gap
- an integer number of pixels