title: Java: Console output in JTable
body: <p>The program should list Volumes in a <code>JTable</code>.</p>
  
  <p>For Example: I get this output form the vollist.java class.</p>
  
  <pre><code>while (volumeIter.hasNext()) {
      volume = volumeIter.next();
      System.out.println(volume.getName());
  }
  </code></pre>
  
  <p>Console Output:</p>
  
  <pre><code>vol1
  vol2
  vol3
  ...
  </code></pre>
  
  <p>How can I get this console output in my <code>JTable</code>.</p>
  
  <pre><code>table = new JTable();
  table.setModel(new DefaultTableModel(
      new Object[][] {
          {null, vollist.volname(null), null, null, null},
          {null, vollist.volname(null), null, null, null},
          {null, vollist.volname(null), null, null, null},
      },
      new String[] {
          "Nr:", "Volume Name", "TotalSize [MB]", "Used [MB]", "Status"
      }
  ));
  </code></pre>
  
  <p>That only displays row1 -> vol1 row2 -> vol1 ...... How can i get an output like in the console row1 -> vol1 row2 -> vol2 (count up)</p>