title: Refresh all data in JTable
body: <p>I have seen quite a few threads on refreshing a JTable using:</p>
  
  <pre><code>String[] columnNames = {"column1","column2,......,"columnN"};
  String[][] tableData = new String[1][columnNames.length];
  JTable table = new JTable(tableData,columnNames);
  
  JScrollPane scrollpane = new JScrollPane(table);
  contentPane.add(scrollpane);
  </code></pre>
  
  <p>... make a change to the data stored in <code>tableData</code> then call...</p>
  
  <pre><code>AbstractTableModel model = (AbstractTableModel) table.getModel();
  model.fireTableDataChanged();
  </code></pre>
  
  <p>But this doesn't seem to change anything for me. I need to initially show display a blank table with one row and then update it when the user loads a data file however the code below doesn't seem to work for me. I assume its because im redefining <code>tableData</code> but this has to be done as i do not know how many rows of data are to be displayed until the user loads a file. How can I update the table?</p>
  
  <hr>
  
  <p><strong>Edit:</strong>
  To make it clearer the code i am running is:</p>
  
  <pre><code>//Initialize Table With 1 Blank Row
  String[] columnNames = {"column1","column2,......,"columnN"};
  String[][] tableData = new String[1][columnNames.length];
  JTable table = new JTable(tableData,columnNames);
  
  JScrollPane scrollpane = new JScrollPane(table);
  contentPane.add(scrollpane);
  
  //When the file is loaded resize tableData so it can fit all the file data
  tableData = new String[length of data file][columnNames.length];
  
  //Update some of the tableData points
  tableData[0][0]="data 1";
  tableData[1][0]="data 2";
  tableData[0][1]="data 3";
  tableData[1][1]="data 4";
  ....etc
  
  //Tell the JTable to update
  AbstractTableModel model = (AbstractTableModel) table.getModel();
  model.fireTableDataChanged();
  </code></pre>