title: Java FX: Getting and editing an object from Observable List
body: <p>I know about the method list.getSelectionModel().getSelectedItem();  and its index version, but heres my problem:</p>
  
  <p>I have setup a List in my GUI which holds Objects of a class Person. In my GUI theres also Text Fields with the attributes of that class (Name,Street,Age etc).</p>
  
  <p>What I did so far is implement a method clickList() which will fill the attribute fields with the data from the selected object in the listview. So the user can edit them from here and press another button which should then update those attributes. </p>
  
  <p>I also setup so you can create a new object from the text form by doing this inside my "OK" Button inside my Controller:</p>
  
  <pre><code>     ObservableList&lt;Person&gt; items = FXCollections.observableArrayList();
       items.add(new Person(tf_vn.getText(), tf_nn.getText(),tf_strasse.getText(), tf_plz.getText(), tf_ort.getText(),genderChoice, sliderAge.getValue());
        list.setItems(items);
  </code></pre>
  
  <p>However what im struggling with is the editing of the already existing Person. Can someone give me some pointers? I know I can get the selected object index but how do I work with it? Basicly I just need to find a way to do something like selectedObject.setAge(),selectedObject.setName() etc </p>
  
  <p>I looked through all the getSelectionModel() methods but didnt find a solution, im sure there is a easy one....</p>
  
  <p>Thanks in advance !</p>