|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TableModel
TableModel interface specifies methods, which Table
component
uses to get data it shows. The following example shows how
the model is being used in Table:
TableModel myTableModel = new MyTableModel();
Table myTable = new Table();
myTable.setModel(myTableModel);
Method Summary | |
---|---|
void |
addTableModelListener(TableModelListener listener)
Adds TableModelListener to this model. |
int |
getColumnCount()
Gets the number of columns of the table |
java.lang.String |
getColumnName(int column)
Gets the name of the given column. |
int |
getRowCount()
Gets the number of rows of the table |
java.lang.Object |
getValue(int column,
int row)
Gets the value of a table cell at a specified location. |
boolean |
isUsingHeaders()
Decides wheter this table is using headers (column names). |
void |
removeTableModelListener(TableModelListener listener)
Removes TableModelListener from this model. |
Method Detail |
---|
void addTableModelListener(TableModelListener listener)
TableModelListener
to this model.
listener
- listener to be addedvoid removeTableModelListener(TableModelListener listener)
TableModelListener
from this model.
listener
- listener to be removedint getColumnCount()
int getRowCount()
boolean isUsingHeaders()
java.lang.String getColumnName(int column)
getColumnCount()
method.
column
- index of column of which the name should be returned. May return null.
java.lang.Object getValue(int column, int row)
getValue(2,3)
returns a cell value from 2nd column and 3rd
row.
The given column and row should never exceed the numbers specified by the
getColumnCount()
or getRowCount()
methods.
column
- column index of the valuerow
- row index of the value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |