title: Can't clear all items (elements) in an ObservableList
body: <p>I've a couple of copied elements in an observablelist which I use for copy/paste operations in a TableView. The name of the table is <strong>cpTable</strong> (<strong>c</strong>opy and <strong>p</strong>aste <strong>T</strong>able) for storing copied elements and to paste elements that are stored in the table. After each paste operation I want to clear the contents of cpTable before I copy other selected items with Ctrl+C.
  But I always get the error:</p>
  
  <blockquote>
    <p>JavaFX Application Thread" java.lang.UnsupportedOperationException:
    Not supported.<br>
    at com.sun.javafx.scene.control.ReadOnlyUnbackedObservableList.remove(ReadOnlyUnbackedObservableList.java:246)</p>
  </blockquote>
  
  <p>Here is my pseudocode:</p>
  
  <pre><code>if (cpTable !=null) {
      //first, get all copied items for removing all elements 
      ObservableList&lt;String&gt; copiedItems = cpTable.getItems();                                 
      int size = copiedItems.size();
  
      // remove all elements 
      for(int i=0;i&lt;size;i++) {
          copiedItems.remove(i);
      }
      cpTable.setItems(copiedItems); //clear cpTable by setting an empty list
  }
  </code></pre>
  
  <p>This is a method that copies the contents of selected items and puts it in a cpTable</p>
  
  <pre><code>public TableView&lt;String&gt; copySelectionToClipboard(TableView&lt;String&gt; table) {            
      ObservableList&lt;String&gt; data =     table.getSelectionModel().getSelectedItems();             
      TableView&lt;String&gt; tmp = new TableView&lt;&gt;();
      tmp.setItems(data);
      return tmp;
  </code></pre>
  
  <p>}    </p>
  
  <p>When Ctrl+C is pressed the following line puts all copied items in a cpTable:</p>
  
  <pre><code>cpTable = copySelectionToClipboard( (TableView&lt;String&gt;) keyEvent.getSource());
  </code></pre>
  
  <p>As mentioned I want to clear all cpTable contents immediately after pasting
  the items in a table.</p>