Class jtableModel

Class jtableModel

Object
   |
   +----AbstractTableModel
           |
           +----jtableModel

public class jtableModel
extends AbstractTableModel

Variable Index

 o data

Constructor Index

 o jtableModel(String[], Object[][])

Method Index

 o addRow()
 o addRow(Object[])
 o cellUpdated(int, int)
 o getColumnClass(int)
JTable uses this method to determine the default renderer/ editor for each cell.
 o getColumnCount()
 o getColumnName(int)
 o getRowCount()
 o getValueAt(int, int)
 o initColumnSizes(JTable)
 o isCellEditable(int, int)
Don't need to implement this method unless your table's editable.
 o removeRow(int)
 o setValueAt(Object, int, int)
 o tableChanged(TableModelEvent)

Variables

 o data
public java.lang.Object[][] data

Constructors

 o jtableModel
public jtableModel(String[] columnNames,
                   Object[][] data)

Methods

 o addRow
public void addRow()
 o addRow
public void addRow(Object[] initialValues)
 o cellUpdated
public void cellUpdated(int row,
                        int col)
 o getColumnClass
public java.lang.Class getColumnClass(int c)
JTable uses this method to determine the default renderer/ editor for each cell. If we didn't implement this method, then the last column would contain text ("true"/"false"), rather than a check box.

Overrides:
getColumnClass in class AbstractTableModel
 o getColumnCount
public int getColumnCount()
Overrides:
getColumnCount in class AbstractTableModel
 o getColumnName
public java.lang.String getColumnName(int col)
Overrides:
getColumnName in class AbstractTableModel
 o getRowCount
public int getRowCount()
Overrides:
getRowCount in class AbstractTableModel
 o getValueAt
public java.lang.Object getValueAt(int row,
                                   int col)
Overrides:
getValueAt in class AbstractTableModel
 o initColumnSizes
public void initColumnSizes(JTable table)
 o isCellEditable
public boolean isCellEditable(int row,
                              int col)
Don't need to implement this method unless your table's editable.

Overrides:
isCellEditable in class AbstractTableModel
 o removeRow
public void removeRow(int row)
 o setValueAt
public void setValueAt(Object value,
                       int row,
                       int col)
Overrides:
setValueAt in class AbstractTableModel
 o tableChanged
public void tableChanged(TableModelEvent e)