package view;
import helper.Loger;
import javax.swing.table.AbstractTableModel;
import model.DTOMessage;
import model.Receive;
public class TableModelReceived extends AbstractTableModel {
private final String headers[];
public TableModelReceived(String columnHeaders[]){
headers = columnHeaders;
}
public int getRowCount()
{
//return Receive.receivedMessage.size();
return Receive.getReceivedMessage().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 = Receive.receivedMessage.get(row);
message = Receive.getReceivedMessage().get(row);
switch (col){
case 0:
return message.getDate();
case 1:
return message.getComputerName();
case 2:
return message.message;
}
return null;
}
}