A table header component depends on a table component and is created automatically by the table whether the table markup has a header (for instance a <thead>).
A header component is not very different to a list but column values (header data model) are managed by the javax.swing.table.TableModel
data model of the parent table (see DefaultTableModel.addColumn(Object)
).
Any change to the header data model is notified to the component and the markup is rendered again. The data model ever mandates over the markup, any initial markup content (initial header cell) is removed.
Almost a header cell must be present in the markup, this cell is used as pattern to create new cells, and is removed because by default the header model is empty.
If a header column is clicked the column is selected.
There is no default header cell decoration when a complete column is selected, use a column selection model listener to detect when a column is selected.
Header cell indexes start in 0.
@author Jose Maria Arranz Santamaria
|
|
|
|