public class TableHeaderCellRenderer
extends java.lang.Object
implements javax.swing.table.TableCellRenderer
TableCellRenderer
that adds a closing icon.Constructor and Description |
---|
TableHeaderCellRenderer(@NotNull javax.swing.ImageIcon closingIcon,
@NotNull javax.swing.table.TableCellRenderer tableCellRenderer)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getTableCellRendererComponent(@NotNull javax.swing.JTable table,
@NotNull java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) |
int |
getX(int index)
Returns the x coordinate of a closing icon.
|
public TableHeaderCellRenderer(@NotNull @NotNull javax.swing.ImageIcon closingIcon, @NotNull @NotNull javax.swing.table.TableCellRenderer tableCellRenderer)
closingIcon
- the icon to display as the closing buttonstableCellRenderer
- the default table cell renderer of the
associated tablepublic java.awt.Component getTableCellRendererComponent(@NotNull @NotNull javax.swing.JTable table, @NotNull @NotNull java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
public int getX(int index)
index
- the index of the closing icon-1
if the index is invalid