public class SortButtonRenderer extends java.lang.Object implements javax.swing.table.TableCellRenderer
This class (and also BevelArrowIcon) is adapted from original code by Nobuo Tamemasa (version 1.0, 26-Feb-1999) posted on www.codeguru.com.
Modifier and Type | Field and Description |
---|---|
static int |
DOWN
Useful constant indicating ASCENDING (that is, arrow pointing down) sorting in the table.
|
static int |
NONE
Useful constant indicating NO sorting.
|
static int |
UP
Useful constant indicating DESCENDING (that is, arrow pointing up) sorting in the table.
|
Constructor and Description |
---|
SortButtonRenderer()
Creates a new button renderer.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Component |
getTableCellRendererComponent(javax.swing.JTable table,
java.lang.Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column)
Returns the renderer component.
|
void |
setPressedColumn(int column)
Sets the pressed column.
|
public static final int NONE
public static final int DOWN
public static final int UP
public SortButtonRenderer()
public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int row, int column)
getTableCellRendererComponent
in interface javax.swing.table.TableCellRenderer
table
- the table.value
- the value.isSelected
- selected?hasFocus
- focussed?row
- the row.column
- the column.public void setPressedColumn(int column)
column
- the column.