title: Turning ArrayList of Rows into a JTable
body: <p>I decided it would be easiest to store my data in a custom Row object based on this post</p>
  <p><a href="https://stackoverflow.com/questions/51163601/java-data-structure-to-store-tabular-data">Java data structure to store tabular data</a></p>
  <p>But Im wondering how I actually go onto then create a JTable with this Array of row objects</p>
  <p>My current attempt starts out looking like this:</p>
  <pre><code>public class TestTable extends JTable {
  private final String[] columnNames = {&quot;col1&quot;, &quot;col2&quot;, &quot;col3&quot;};
      public TestTable() {
      DefaultTableModel model = new DefaultTableModel(columnNames, 10); //10 is just a placeholder for the number of rows as I dont know how to add the data yet
      }
  }
  </code></pre>
  <p>My data would be stored in an ArrayList that looks like this:</p>
  <pre><code>Row row1 = new Row(&quot;1&quot;, &quot;2&quot;, &quot;3&quot;);
  ArrayList&lt;String&gt; data = new ArrayList&lt;String&gt;;
  data.add(row1);
  data.add(row2);
  ...
  data.add(row10);
  </code></pre>
  <p>where my final ArrayList would just look like a list of row objects</p>