title: JavaFX Observable list not updating GUI properly after being bound to listview
body: <p><strong>Issue</strong>:</p>
  
  <p>After receiving a message from a the <code>MessageListener</code> class adds a message to a <code>private final ObservableList&lt;String&gt;</code> which in turn updates the GUI on change. the problem is that this happens inconsistently and for some unknown reason there seems to be 2 lists that interchange in adding the message to its list. </p>
  
  <p>here is a log of this behavior:</p>
  
  <pre><code>INFO: Message received: 
  Text: SSN= 1223 Requested amount= 11€ time= 110
  ID: ID:78-192.168.0.23(84:be:e3:92:5b:b3)-1-1519325025180
  Reply to: null
  Feb 22, 2018 7:43:45 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:SSN= 1223 Requested amount= 11€ time= 110
  Feb 22, 2018 7:43:45 PM Bank.ABNAmbro addMessages
  INFO: New size: 2
  
  Feb 22, 2018 7:43:54 PM Bank.BankMessageListener onMessage
  INFO: Message received: 
  Text: SSN= 1223 Requested amount= 11€ time= 110
  ID: ID:82-192.168.0.23(84:be:e3:92:5b:b3)-1-1519325034484
  Reply to: null
  Feb 22, 2018 7:43:54 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:SSN= 1223 Requested amount= 11€ time= 110
  Feb 22, 2018 7:43:54 PM Bank.ABNAmbro addMessages
  INFO: New size: 9
  
  Feb 22, 2018 7:43:55 PM Bank.BankMessageListener onMessage
  INFO: Message received: 
  Text: SSN= 1223 Requested amount= 11€ time= 110
  ID: ID:86-192.168.0.23(84:be:e3:92:5b:b3)-1-1519325035575
  Reply to: null
  Feb 22, 2018 7:43:55 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:SSN= 1223 Requested amount= 11€ time= 110
  Feb 22, 2018 7:43:55 PM Bank.ABNAmbro addMessages
  INFO: New size: 10
  
  Feb 22, 2018 7:43:57 PM Bank.BankMessageListener onMessage
  INFO: Message received: 
  Text: SSN= 1223 Requested amount= 11€ time= 110
  ID: ID:90-192.168.0.23(84:be:e3:92:5b:b3)-1-1519325037074
  Reply to: null
  Feb 22, 2018 7:43:57 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:SSN= 1223 Requested amount= 11€ time= 110
  Feb 22, 2018 7:43:57 PM Bank.ABNAmbro addMessages
  INFO: New size: 11
  
  Feb 22, 2018 7:43:58 PM Bank.BankMessageListener onMessage
  INFO: Message received: 
  Text: SSN= 1223 Requested amount= 11€ time= 110
  ID: ID:94-192.168.0.23(84:be:e3:92:5b:b3)-1-1519325038499
  Reply to: null
  Feb 22, 2018 7:43:58 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:SSN= 1223 Requested amount= 11€ time= 110
  Feb 22, 2018 7:43:58 PM Bank.ABNAmbro addMessages
  INFO: New size: 3
  </code></pre>
  
  <p>If I mock the <code>MessageListener</code> class to just add a <code>String</code> every few seconds the log shows 2 lists that have the same size.</p>
  
  <pre><code>Feb 22, 2018 9:12:16 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 0
  Feb 22, 2018 9:12:16 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 0
  
  Feb 22, 2018 9:12:16 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 0
  Feb 22, 2018 9:12:16 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 0
  
  Feb 22, 2018 9:12:17 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 1
  Feb 22, 2018 9:12:17 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 1
  
  Feb 22, 2018 9:12:17 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 1
  Feb 22, 2018 9:12:17 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 1
  
  Feb 22, 2018 9:12:18 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 2
  Feb 22, 2018 9:12:18 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 2
  
  Feb 22, 2018 9:12:18 PM Bank.ABNAmbro addMessages
  INFO: Adding message to List:Test 2
  Feb 22, 2018 9:12:18 PM Bank.ABNAmbro addMessages
  INFO: New sieze: 2
  </code></pre>
  
  <p>The Controller class:</p>
  
  <pre><code>package Bank;
  
  import javafx.application.Application;
  import javafx.application.Platform;
  import javafx.collections.FXCollections;
  import javafx.collections.ObservableList;
  import javafx.event.ActionEvent;
  import javafx.fxml.FXML;
  import javafx.fxml.FXMLLoader;
  import javafx.scene.Parent;
  import javafx.scene.Scene;
  import javafx.scene.control.ListView;
  import javafx.stage.Stage;
  
  import javax.jms.*;
  import javax.naming.InitialContext;
  import javax.naming.NamingException;
  import java.io.IOException;
  import java.util.ArrayList;
  import java.util.List;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class ABNAmbro extends Application implements Bank {
  
      private String tile = "bank";
  
      private List&lt;String&gt; messages = new ArrayList&lt;String&gt;();
  
      private final ObservableList&lt;String&gt; olMessages = FXCollections.observableArrayList(messages);
  
      Logger logger = Logger.getLogger("ABNAmbro");
  
      @FXML
      ListView lsRequestView;
  
      @Override
      public void start(Stage primaryStage) throws IOException {
          Parent root = FXMLLoader.load(getClass().getResource("/Bank/Bank.fxml"));
  
          Scene scene = new Scene(root);
  
          primaryStage.setTitle(tile);
          primaryStage.setScene(scene);
          primaryStage.show();
      }
  
      @FXML
      public void initialize() {
          lsRequestView.setItems(olMessages);
      }
  
      public ABNAmbro() throws NamingException {
  
          tile = "ABNAmbro Loan Department.";
          String queuename = "ABNBankqueue";
          MessageListener messageListener = new BankMessageListener(this);
  
          InitialContext initialContext = new InitialContext();
  
          //JMS 2.0 lookup
          ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("java:comp/DefaultJMSConnectionFactory");
  
          //Creating context to reseive messages
          JMSContext context = connectionFactory.createContext();
          Queue queue = (Queue) initialContext.lookup(queuename);
  
          //create consumer and add a message listener to it so it can get its message async 
          JMSConsumer consumer = context.createConsumer(queue);
          consumer.setMessageListener(messageListener);
  
      }
  
      @FXML
      public void SendResponse(ActionEvent event) {
  
      }
  
      public void addMessages(final String messages) {
          logger.log(Level.INFO,"Adding message to List:" + messages);
          Platform.runLater(new Runnable() {
              @Override
              public void run() {
  
                  //adding message to list
                  olMessages.add(messages);
              }
          });
          logger.log(Level.INFO, "New sieze: " + olMessages.size());
      }
  
  }
  </code></pre>
  
  <p>MessageListener:</p>
  
  <pre><code>package Bank;
  
  import javax.jms.JMSException;
  import javax.jms.Message;
  import javax.jms.MessageListener;
  import javax.jms.TextMessage;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  public class BankMessageListener implements MessageListener{
  
      private Bank bank;
      private Logger logger;
  
      public BankMessageListener(Bank bank){
          this.bank = bank;
          logger = Logger.getLogger("BankMessageListener");
      }
  
      public void onMessage(final Message message) {
          try {
              logger.log(Level.INFO,"Message received: \n" +
                      "Text: "+((TextMessage)message).getText()
                      + "\nID: " +message.getJMSMessageID()
                      + "\nReply to: "  +((message.getJMSReplyTo() != null) ? message.getJMSReplyTo().toString() : "null")
  
              );
              bank.addMessages(((TextMessage) message).getText());
          } catch (JMSException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>