title: Insert values from ArrayList into a JTable
body: <pre><code>public void populateJTable() {        
      DefaultTableModel model = (DefaultTableModel) jTable1.getModel();
      Object[] rowData = new Object[4];
      TrackService ts = new TrackService();
      ArrayList&lt;Track&gt; tracks = ts.jsonToTracks();
  
      for (int i = 0; i &lt; tracks.size(); i++) {
          rowData[0] = tracks.get(i).getTrackName();
          rowData[1] = tracks.get(i).getArtist();
          model.addRow(rowData);
      }
      jTable1 = new JTable(model);
  }
  </code></pre>
  
  <p>In my json file I have stored metadata of an mp3 file which stores 5 values. My 'jsonToTracks' method stores them in an ArrayList. 
  I'm trying to get 2 of the values (trackName and artist) from inside my ArrayList and display them in my JTable. 
  My JTable has 4 columns - Name, Artist, Key, Mood. I'm trying to store the trackName and Artist in their corresponding columns. The Key and Mood column should be blank and the Name and Artist fields should be populated. 
  I can't see what I'm doing wrong, can anyone help?</p>