title: How to create JTable that is initially empty and then fill it out with the data from CSV file?
body: <p>I want to create JTable that is initially empty. Then a user may load data from CSV file. So, it means that the number of rows in <code>rowData</code> is not known apriori. How should I change this line <code>Object rowData[][] = new Object[][]{};</code> to fit my goal?</p>
  
  <pre><code>import javax.swing.table.AbstractTableModel;
  
  class PaxListTableModel extends AbstractTableModel {
  
    Object rowData[][] = new Object[][]{};
  
    String columnNames[] = Constants.columnNamesPax;
  
    public int getColumnCount() {
      return columnNames.length;
    }
  
    public String getColumnName(int column) {
      return columnNames[column];
    }
  
    public int getRowCount() {
      return rowData.length;
    }
  
    public Object getValueAt(int row, int column) {
      return rowData[row][column];
    }
  
    public Class getColumnClass(int column) {
      return (getValueAt(0, column).getClass());
    }
  
    public void setValueAt(Object value, int row, int column) {
      rowData[row][column] = value;
    }
  
    public boolean isCellEditable(int row, int column) {
      return (column != 10);
    }
  }
  </code></pre>