package view;
import helper.Loger;
import javax.swing.table.AbstractTableModel;
import model.DTOMessage;
import model.Receive;
import model.Send;
public class TableModelSend extends AbstractTableModel {
private final String headers[];
public TableModelSend(String columnHeaders[]){
headers = columnHeaders;
}
public int getRowCount()
{
return Send.sendMessage.size();
}
public int getColumnCount()
{
return 3;
}
public String getColumnName(int col) {
return headers[col];
}
public void changed(){
fireTableDataChanged();
}
public Object getValueAt( int row, int col )
{
DTOMessage message;
message = Send.sendMessage.get(row);
switch (col){
case 0:
return message.getDate();
case 1:
return message.to;
case 2:
return message.message;
}
return null;
}
}