|
Creating |
Top Previous Next |
FilterTableModel filters the data presented to it by an underlying ListTableModel instance. See ListTableModel for more information.
You can construct a FilterTableModel with the constructor:
FilterTableModel(ListTableModel tableModel);
The underlying ListTableModel can be passed as an argument in the constructor or can be specified later via FilterTableModel's superclass (ListTableMap) method:
public void setModel(ListTableModel newModel);
Example: Create a FilterTableModel
(1)
ListTableModel unfilteredModel = new DefaultListTableModel();
FilterTableModel filteredModel = new FilterTableModel(unfilteredModel);
JTable table = new JTable();
table.setModel(filteredModel);
(2)
ListTableModel unfilteredModel = new DefaultListTableModel();
FilterTableModel filteredModel = new FilterTableModel(unfilteredModel);
JTable table = new JTable(filteredModel);