title: Databind ListView from ArrayList - javafx
body: <p>I have an ArrayList :</p>
  
  <pre><code>List&lt;Column&gt; listOfColumns = new ArrayList();
  </code></pre>
  
  <p>How can I bind this list to a listView? It should always show the columns inside this list.</p>
  
  <p>Also, I use </p>
  
  <pre><code>    final ObservableList&lt;Columns&gt; data = FXCollections.observableArrayList();
  </code></pre>
  
  <p>right now to make the ListView only contain Columns, but a Column is an object which contains a name(string) and an array list, so right now my ListView shows both the name of the column and the content of the array list in the Column. Is there any way to make the ListView only show the name of the column? </p>
  
  <p><img src="https://i.stack.imgur.com/fvGqn.png" alt="enter image description here"></p>
  
  <p>The reason I do it like this, is because then I can use listView.getSelectionModel().getSelectedItem(), and it returns a column. </p>