title: Connect a list of objects to a JTable
body: <p>I have a list of objects of type SI (SingleInstruction) in Java.
  Here is the SI class with its constructor. </p>
  
  <pre><code>    public class SI {
          private String recipe;
          private Integer makingOrder;
          private String instruction;
          private double estimatedTimeInMinutesSeconds;
          private Double timerInMinutesSeconds;
          private String timerEndingText;
          private boolean containsOtherInstructions = false;
          private List&lt;SI&gt; embeddedInstructionsList;
  
          public SI (String s1, Integer i1, String s2, double d1, Double d2, String s3){
              recipe = s1;
              makingOrder = i1;
              instruction = s2;
              estimatedTimeInMinutesSeconds = d1;
              timerInMinutesSeconds = d2;
              timerEndingText = s3;
          }
  setters and getters methods ommited....
  </code></pre>
  
  <p>I need to have a table in my GUI that displays the data of this list.
  When I begin the program I create a</p>
  
  <pre><code>public List&lt;SI&gt; finalList = new ArrayList();
  </code></pre>
  
  <p>which is empty so I need an empty table to be displayed.
  The table should have columns of </p>
  
  <blockquote>
    <p>(String Recipe, Integer Order,  String Instruction, double Est.time,
    Double Timer, String TimerText,  boolean containOtherInstructions)</p>
  </blockquote>
  
  <p>Afterwards the finalList is filled with data and I need these data to be displayed in the table. 
  In order to give you an example, I created a button that creates some SI and adds them to the finalList.</p>
  
  <pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
      SI si1 = new SI("Greek Salad", 1, "cut veggies", 4, null, null);
      SI si2 = new SI("Greek Salad", 2, "put spices", 1, null, null);
      SI si3 = new SI("Greek Salad", 3, "feta and finish", 1, null, null);
      SI si4 = new SI("Break", null, "Your free 10 minutes", 10, null, null);
      SI si5 = new SI("Meat", 1, "preheat oven", 0.5, 10.0, "oven is ready");
      SI si6 = new SI("Meat", 2, "spices on meat", 2, null, null);
      SI si7 = new SI("Meat", 3, "cook meat", 1, 10.0, "meat is ready");
      SI si8 = new SI("Meat", 4, "serve", 1, null, null);
      SI si9 = new SI("Break", null, "Your free 10 minutes", 10, null, null);
      SI si10 = new SI("Jelly", 1, "Boil water", 0.5, 4.0, "water is ready");
      SI si11 = new SI("Jelly", 2, "add mix and stir", 4, null, null);
      SI si12 = new SI("Jelly", 3, "share in bowls, wait 3 hours", 2, null, null);
      finalList.add(si1);
      finalList.add(si2);
      finalList.add(si3);
      finalList.add(si4);
      finalList.add(si5);
      finalList.add(si6);
      finalList.add(si7);
      finalList.add(si8);
      finalList.add(si9);
      finalList.add(si10);
      finalList.add(si11);
      finalList.add(si12);
  }
  </code></pre>
  
  <p>Now I need that when I press the button, the table is updated and displays the data.
  I've tried a lot to find out how to do it but it is too hard. I'm not sure if I should extend AbstractTableModel or just use the defaultTableModel.</p>
  
  <p>To help you give me suggestions, the data of this table is final and user can't modify any cell. what should be allowed to the user to do though is to move rows up or down to change the order in the finalList. </p>
  
  <p>PS: I am using netbeans, if you have any quick suggestions on the GUI builder.</p>