Package no.uib.jsparklines.extra
Class CellHighlighterRenderer
java.lang.Object
no.uib.jsparklines.extra.CellHighlighterRenderer
- All Implemented Interfaces:
TableCellRenderer
public class CellHighlighterRenderer extends Object implements TableCellRenderer
Table cell render highlighting columns ending with a given string, by using a
different background color. Supported input: String objects. Other object
types are rendered using the DefaultTableCellRenderer.
- Author:
- Harald Barsnes
-
Constructor Summary
Constructors Constructor Description CellHighlighterRenderer(Color backgroundColor, Color highlightColor, int align, String highlightLabel)
Creates a new CellHighlighterRenderer. -
Method Summary
Modifier and Type Method Description Component
getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
-
Constructor Details
-
CellHighlighterRenderer
public CellHighlighterRenderer(Color backgroundColor, Color highlightColor, int align, String highlightLabel)Creates a new CellHighlighterRenderer.- Parameters:
backgroundColor
- default background colorhighlightColor
- highlight background coloralign
- SwingConstant: LEFT, CENTER, RIGHT, LEADING or TRAILING.highlightLabel
- the label the strings have to end with in order to be highlighted
-
-
Method Details
-
getTableCellRendererComponent
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)- Specified by:
getTableCellRendererComponent
in interfaceTableCellRenderer
-