|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--gui.AddressBookFrame.MyTableModel
TableModel
Field Summary | |
private java.lang.String[] |
columnNames
Kolumnrubriker. |
private java.util.Vector |
data
Innehåller adressboken. |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
AddressBookFrame.MyTableModel()
Skapar ny modell. |
Method Summary | |
void |
addRow()
Lägger till en rad i modellen. |
java.lang.Class |
getColumnClass(int c)
Returns the most specific superclass for all the cell values in the column. |
int |
getColumnCount()
Returns the number of columns in the model. |
java.lang.String |
getColumnName(int col)
Returns the name of the column at col . |
java.util.Vector |
getData()
Returnerar en Vector innehållande modellens data. |
int |
getRowCount()
Returns the number of rows in the model. |
java.lang.Object |
getValueAt(int row,
int col)
Returns the value for the cell at col and row . |
boolean |
isCellEditable(int row,
int col)
Returns true if the cell at row and col is editable.
|
void |
removeRow(int row)
Tar bort en rad i modellen. |
void |
setData(java.util.Vector data)
Sätter modellens data. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Sets the value in the cell at col and row to value . |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.lang.String[] columnNames
private java.util.Vector data
Constructor Detail |
public AddressBookFrame.MyTableModel()
Method Detail |
public int getColumnCount()
public int getRowCount()
public java.lang.String getColumnName(int col)
col
.
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
col
- the index of the column.
public java.util.Vector getData()
public void setData(java.util.Vector data)
data
- modellens data.public java.lang.Object getValueAt(int row, int col)
col
and row
.
row
- the row whose value is to be queried.col
- the column whose value is to be queried.
public java.lang.Class getColumnClass(int c)
getColumnClass
in interface javax.swing.table.TableModel
getColumnClass
in class javax.swing.table.AbstractTableModel
c
- the index of the column.
public void addRow()
public void removeRow(int row)
row
- radnumret.public boolean isCellEditable(int row, int col)
row
and col
is editable.
Otherwise, setValueAt
on the cell will not change the value of that cell.
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
row
- the row whose value to be queried.col
- the column whose value to be queried.
public void setValueAt(java.lang.Object value, int row, int col)
col
and row
to value
.
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
value
- the new value.row
- the row whose value is to be changed.col
- the column whose value is to be changed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |