Package view

Source Code of view.TableModelSend

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;
       
  }
}
TOP

Related Classes of view.TableModelSend

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.