title: I am trying to put the content an String to ListView
body: <p>I am trying to put the content an String to ListView. After running the code, the object of ListView contains null. I am not sure where is the problem? any help please!! Not to forget that employee it an object of Tap class which is located in TabLayout.</p>
  
  <pre><code>//Step 1. Create and initialize the array.
  String[] temp = {"Book", "Notebook", "pen", "pencil"};
  
  //Step 2. Convert the array to ObservablList
  ObservableList&lt;String&gt; strList = FXCollections.observableArrayList(temp);
  
  //Step 3. Convert the ObservableList to ListView
  ListView&lt;String&gt; listView = new ListView&lt;&gt;(strList);
  
  //Step 4. Add the content of ListView to the employee Tap. 
  employee.setContent(listView);
  </code></pre>
  
  <p>The except is thrown when step 4 is executed. I think this happens because of step 3. The object of the elements ListView are null. </p>