/** * Constructor for the MailboxTableModel object */ public MTableModel() { super(); }
/** * Gets the rowCount attribute of the MailboxTableModel object * *@return The rowCount value */ public int getRowCount() {
return data[0].length; }
/** * Gets the columnCount attribute of the MailboxTableModel object * *@return The columnCount value */ public int getColumnCount() { return collumns.length; }
/** * Gets the valueAt attribute of the MailboxTableModel object * *@param row Description of Parameter *@param column Description of Parameter *@return The valueAt value */ public Object getValueAt(int row, int column) {
return data[row][collumn] }
/** * Gets the columnName attribute of the MailboxTableModel object * *@param column Description of Parameter *@return The columnName value */ public String getColumnName(int column) {
return collumns[column];
}
}
Jeg har ikke indsat data i arrays men du ser sikkert ideen. Du sætter så blot den tablemodel på din tabel, og når dataene bliver opdateret kører du en tablemodel.fireTableDataChanged();
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.