|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.table.DefaultTableModel
public class DefaultTableModel
A default implementation of the table model based on a two dimensional array.
Constructor Summary | |
---|---|
DefaultTableModel(java.lang.String[] columnNames,
java.lang.Object[][] data)
Constructs a new table with a 2 dimensional array for row/column data |
|
DefaultTableModel(java.lang.String[] columnNames,
java.lang.Object[][] data,
boolean editable)
Constructs a new table with a 2 dimensional array for row/column data |
Method Summary | |
---|---|
void |
addDataChangeListener(DataChangedListener d)
Adds a listener to the data changed event |
int |
getColumnCount()
Returns the number of columns in the table |
java.lang.String |
getColumnName(int i)
Returns the name of the column at the given offset |
int |
getRowCount()
Returns the number of rows in the table |
java.lang.Object |
getValueAt(int row,
int column)
Returns the value of the cell at the given location |
boolean |
isCellEditable(int row,
int column)
Returns true if the cell at the given location is an editable cell |
void |
removeDataChangeListener(DataChangedListener d)
Removes a listener to the data changed event |
void |
setValueAt(int row,
int column,
java.lang.Object o)
Sets the value of the cell at the given location |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultTableModel(java.lang.String[] columnNames, java.lang.Object[][] data)
columnNames
- the names of the columnsdata
- the data within the tablepublic DefaultTableModel(java.lang.String[] columnNames, java.lang.Object[][] data, boolean editable)
columnNames
- the names of the columnsdata
- the data within the tableeditable
- indicates whether table cells are editable or not by defaultisCellEditable(int, int)
Method Detail |
---|
public int getRowCount()
TableModel
getRowCount
in interface TableModel
public int getColumnCount()
TableModel
getColumnCount
in interface TableModel
public java.lang.String getColumnName(int i)
TableModel
getColumnName
in interface TableModel
i
- the offset for the column name
public boolean isCellEditable(int row, int column)
TableModel
isCellEditable
in interface TableModel
row
- the cell rowcolumn
- the cell column
public java.lang.Object getValueAt(int row, int column)
TableModel
getValueAt
in interface TableModel
row
- the cell rowcolumn
- the cell column
public void setValueAt(int row, int column, java.lang.Object o)
TableModel
setValueAt
in interface TableModel
row
- the cell rowcolumn
- the cell columno
- the value of the cell at the given locationpublic void addDataChangeListener(DataChangedListener d)
TableModel
addDataChangeListener
in interface TableModel
d
- the new listenerpublic void removeDataChangeListener(DataChangedListener d)
TableModel
removeDataChangeListener
in interface TableModel
d
- the listener to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |