title: Table not updated with new row
body: <p>I finally got the content into my table (because I've been mastering that mystery out for ages!). Now I'd like to add new Items to the list AND automatically update the table. I thought an ObservableList would do the trick but there seems to be more to it. Can you provide me with a solution?</p>
  
  <p><strong>Controller class:</strong></p>
  
  <pre><code>package controller;
  
  import java.lang.reflect.Constructor;
  
  import db.ItemLijst;
  import db.Klant;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.fxml.FXML;
  import javafx.scene.control.Button;
  import javafx.scene.control.ChoiceBox;
  import javafx.scene.control.TableColumn;
  import javafx.scene.control.TableView;
  import javafx.scene.control.TextField;
  import javafx.scene.control.cell.PropertyValueFactory;
  import model.Item;
  import model.ItemTypes;
  
  public class SchermController {
      @FXML
      private TableView&lt;Item&gt; tblItems;
      @FXML
      private TableView&lt;Klant&gt; tblKlanten;
  //  @FXML
  //  private TableView&lt;Uitlening&gt; tblUitleningen;
      @FXML
      private Button btnItemToevoegen;
      @FXML
      private Button btnKlantToevoegen;
      @FXML
      private Button btnRegistreer;
      @FXML
      private ChoiceBox&lt;ItemTypes&gt; cbTypes;
      @FXML
      private ChoiceBox&lt;Item&gt; cbItems;
      @FXML
      private ChoiceBox&lt;Klant&gt; cbKlanten;
      @FXML
      private TextField tfTitel;
      @FXML
      private TextField tfVoornaam;
      @FXML
      private TextField tfAchternaam;
      @FXML
      private TextField tfStraat;
      @FXML
      private TextField tfNummer;
      @FXML
      private TextField tfPostcode;
      @FXML
      private TextField tfGemeente;
      @FXML
      private TableColumn&lt;Item, String&gt; tcID;
      @FXML
      private TableColumn&lt;Item, ItemTypes&gt; tcType;
      @FXML
      private TableColumn&lt;Item, String&gt; tcTitel;
      @FXML
      private TableColumn&lt;Item, String&gt; tcUitgeleend;
      private ObservableList&lt;Item&gt; items = FXCollections.observableArrayList();
  
      @FXML
      private void initialize()
      {
              /*
               * ItemLijst is a static object (or object with all static 
  methods). the CD, Film and Spel classes automatically add their record to 
  this class. Literally translated it means ItemList. I thought by making this 
  an ObservableList, the table would be automatically update its records 
  depending on a change to this variable (ItemLijst.items&lt;Item&gt;)?
               */
          items = FXCollections.observableArrayList(ItemLijst.getItems());
  
          tcID.setCellValueFactory(new PropertyValueFactory&lt;Item, String&gt;("ID"));
          tcType.setCellValueFactory(new PropertyValueFactory&lt;Item, ItemTypes&gt;("Type"));
          tcTitel.setCellValueFactory(new PropertyValueFactory&lt;Item, String&gt;("Titel"));
          tcUitgeleend.setCellValueFactory(new PropertyValueFactory&lt;Item, String&gt;("UitgeleendString"));
          tblItems.setItems(items);
  
          // Item types
          cbTypes.setItems(FXCollections.observableArrayList(ItemTypes.values()));
  
          btnItemToevoegen.setOnAction(e -&gt; {
              try {
                  itemToevoegen();
              } catch (Exception e1) {
                  System.out.println("Probleem: " + e1.getMessage());
              }
          });
      }
  
  /**
  * This is the method which I use to add a new item to the CD, Film or Spel 
  class (which inherits the Item class).
  
  */
      private void itemToevoegen() throws Exception
      {
          // Validatie
          if (cbTypes.getValue() == null ) {
              throw new Exception("Je moet een type kiezen");
          } else if (tfTitel.getText().trim().isEmpty()) {
              throw new Exception("Je moet een titel ingeven");
          }
  
          Class&lt;?&gt; klasse = Class.forName("model." + cbTypes.getValue().toString());
          Constructor&lt;?&gt; cons = klasse.getConstructor(String.class);
          cons.newInstance(tfTitel.getText());
      }
  }
  </code></pre>
  
  <p><strong>FXML:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  
  &lt;?import javafx.scene.control.*?&gt;
  &lt;?import java.lang.*?&gt;
  &lt;?import javafx.scene.layout.*?&gt;
  
  &lt;AnchorPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="438.0" prefWidth="743.0" xmlns="http://javafx.com/javafx/8.0.40" xmlns:fx="http://javafx.com/fxml/1" fx:controller="controller.SchermController"&gt;
     &lt;children&gt;
        &lt;TabPane layoutX="-1.0" prefHeight="438.0" prefWidth="744.0" tabClosingPolicy="UNAVAILABLE"&gt;
          &lt;tabs&gt;
            &lt;Tab closable="false" text="Items"&gt;
              &lt;content&gt;
                &lt;AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="367.0" prefWidth="766.0"&gt;
                       &lt;children&gt;
                          &lt;TableView fx:id="tblItems" layoutX="14.0" layoutY="14.0" prefHeight="343.0" prefWidth="714.0"&gt;
                            &lt;columns&gt;
                              &lt;TableColumn fx:id="tcID" prefWidth="303.0" text="Item ID" /&gt;
                              &lt;TableColumn fx:id="tcType" prefWidth="76.0" text="Type" /&gt;
                              &lt;TableColumn fx:id="tcTitel" prefWidth="236.0" text="Titel" /&gt;
                                &lt;TableColumn fx:id="tcUitgeleend" prefWidth="98.0" text="Uitgeleend" /&gt;
                            &lt;/columns&gt;
                          &lt;/TableView&gt;
                          &lt;ChoiceBox fx:id="cbTypes" layoutX="23.0" layoutY="365.0" prefWidth="150.0" /&gt;
                          &lt;TextField fx:id="tfTitel" layoutX="201.0" layoutY="365.0" prefHeight="26.0" prefWidth="352.0" promptText="Titel van item" /&gt;
                          &lt;Button fx:id="btnItemToevoegen" layoutX="592.0" layoutY="365.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="131.0" text="Toevoegen" /&gt;
                       &lt;/children&gt;
                    &lt;/AnchorPane&gt;
              &lt;/content&gt;
            &lt;/Tab&gt;
            &lt;Tab closable="false" text="Klanten"&gt;
              &lt;content&gt;
                &lt;AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"&gt;
                       &lt;children&gt;
                          &lt;TableView fx:id="tblKlanten" layoutX="14.0" layoutY="14.0" prefHeight="343.0" prefWidth="714.0"&gt;
                             &lt;columns&gt;
                                &lt;TableColumn prefWidth="89.0" text="Klant ID" /&gt;
                                &lt;TableColumn prefWidth="87.0" text="Voornaam" /&gt;
                                &lt;TableColumn prefWidth="105.0" text="Achternaam" /&gt;
                                &lt;TableColumn prefWidth="154.0" text="Straat" /&gt;
                                &lt;TableColumn prefWidth="54.0" text="Nr" /&gt;
                                &lt;TableColumn prefWidth="96.0" text="Postcode" /&gt;
                                &lt;TableColumn prefWidth="128.0" text="Gemeente" /&gt;
                             &lt;/columns&gt;
                          &lt;/TableView&gt;
                          &lt;TextField fx:id="tfVoornaam" layoutX="14.0" layoutY="365.0" prefHeight="26.0" prefWidth="105.0" promptText="Voornaam" /&gt;
                          &lt;TextField fx:id="tfAchternaam" layoutX="125.0" layoutY="365.0" prefHeight="26.0" prefWidth="94.0" promptText="Achternaam" /&gt;
                          &lt;TextField fx:id="tfStraat" layoutX="243.0" layoutY="365.0" prefHeight="26.0" prefWidth="150.0" promptText="Straat" /&gt;
                          &lt;TextField fx:id="tfNummer" layoutX="396.0" layoutY="365.0" prefHeight="26.0" prefWidth="32.0" promptText="Nr" /&gt;
                          &lt;TextField fx:id="tfPostcode" layoutX="431.0" layoutY="365.0" prefHeight="26.0" prefWidth="60.0" promptText="Postcode" /&gt;
                          &lt;TextField fx:id="tfGemeente" layoutX="494.0" layoutY="365.0" prefHeight="26.0" prefWidth="130.0" promptText="Gemeente" /&gt;
                          &lt;Button fx:id="btnKlantToevoegen" layoutX="635.0" layoutY="365.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="93.0" text="Toevoegen" /&gt;
                       &lt;/children&gt;
                    &lt;/AnchorPane&gt;
              &lt;/content&gt;
            &lt;/Tab&gt;
              &lt;Tab closable="false" text="Uitleningen"&gt;
                &lt;content&gt;
                  &lt;AnchorPane minHeight="0.0" minWidth="0.0" prefHeight="180.0" prefWidth="200.0"&gt;
                       &lt;children&gt;
                          &lt;TableView fx:id="tblUitleningen" layoutX="14.0" layoutY="14.0" prefHeight="343.0" prefWidth="714.0"&gt;
                             &lt;columns&gt;
                                &lt;TableColumn prefWidth="92.0" text="Klant ID" /&gt;
                                &lt;TableColumn prefWidth="324.0" text="Item ID" /&gt;
                                &lt;TableColumn prefWidth="155.0" text="Start Uitleen" /&gt;
                                &lt;TableColumn prefWidth="142.0" text="Eind Uitleen" /&gt;
                             &lt;/columns&gt;
                          &lt;/TableView&gt;
                          &lt;ChoiceBox fx:id="cbItems" layoutX="15.0" layoutY="364.0" prefHeight="26.0" prefWidth="185.0" /&gt;
                          &lt;ChoiceBox fx:id="cbKlanten" layoutX="244.0" layoutY="364.0" prefHeight="26.0" prefWidth="203.0" /&gt;
                          &lt;Button fx:id="btnRegistreer" layoutX="497.0" layoutY="364.0" mnemonicParsing="false" prefHeight="26.0" prefWidth="229.0" text="Registreer Uitlening" /&gt;
                       &lt;/children&gt;
                    &lt;/AnchorPane&gt;
                &lt;/content&gt;
              &lt;/Tab&gt;
          &lt;/tabs&gt;
        &lt;/TabPane&gt;
     &lt;/children&gt;
  &lt;/AnchorPane&gt;
  </code></pre>