I've managed to lurk around and find a good class which offers to substitute `JTable(Object[][] data, Object[] columnNames)` with `RowTableModel(List<T> modelData, List<String> columnNames)` instead which is great as it allows me to dynamic add my Student data directly from my students.ser file.

After spending God knows how long, I haven't been able to fix a strange issue. The table is displaying everything properly except the data inside itself.

---

This is the current result:
![enter image description here](https://i.stack.imgur.com/icNoY.png)

Obviously those empty rows are the number of Student that I have(5 in this case), however none of the data is printed.

My thought is that I need to assign a specific Student field to each column, Eg. For row Name I assign Student.getName()

---

If you would like to check out [RowTableModel](http://tips4java.wordpress.com/2008/11/21/row-table-model/)

Here is the documented class methods/constructors that I've used:

**Constructor**

```
/**
 *  Constructs a <code>RowTableModel</code> with initial data and
 *  customized column names.
 *
 *  Each item in the <code>modelData</code> List must also be a List Object
 *  containing items for each column of the row.
 *
 *  Each column's name will be taken from the <code>columnNames</code>
 *  List and the number of colums is determined by thenumber of items
 *  in the <code>columnNames</code> List.
 *
 *  Sub classes creating a model using this constructor must make sure
 *  to invoke the setRowClass() method.
 *
 * @param modelData      the data of the table
 * @param columnNames      <code>List</code> containing the names
 *                          of the new columns
 */
protected RowTableModel(List<T> modelData, List<String> columnNames)
{
    setDataAndColumnNames(modelData, columnNames);
}

```

**setDataAndColumnNames:**

```
/**
 *  Reset the data and column names of the model.
 *
 *  A fireTableStructureChanged event will be generated.
 *
 * @param modelData      the data of the table
 * @param columnNames      <code>List</code> containing the names
 *                          of the new columns
 */
protected void setDataAndColumnNames(List<T> modelData, List<String> columnNames)
{
    this.modelData = modelData;
    this.columnNames = columnNames;
    columnClasses = new Class[getColumnCount()];
    isColumnEditable = new Boolean[getColumnCount()];
    fireTableStructureChanged();
}

```

---

**getValueAt(int row, int col) - Working code!:**

```
@Override
    public Object getValueAt(int row, int col) {
        Student myStudent = getRow(row);
        switch(col){
            case 1: return students.get(row).getTeacherId();
            case 2: return students.get(row).getId();
            case 3: return students.get(row).getName();
            case 4: return students.get(row).getSurname();
            case 5: return students.get(row).getEmail();
            case 6: return students.get(row).getDateOfBirth();
            case 7: return students.get(row).getTel();
            case 8: return students.get(row).getCourse();
            case 9: return students.get(row).isOOP();
            case 10: return students.get(row).getYearOfMembership();
            case 11: return students.get(row).hasConsent();
            default: return null;
        }
    }

```