title: TreeView of objects having child nodes that are fields of the object
body: <p>I have an object with fields of varying datatypes: </p>
  
  <pre><code>public class MyObject{
       private String field1;
       private CustomObject field2;
       private int field3;
       ...
  }
  </code></pre>
  
  <p>I want to create a tree view of <code>MyObject</code> that will have multiple <code>MyObject</code> nodes, each with the fields (<code>field1</code>, <code>field2</code>, <code>field3</code>..etc) as children.</p>
  
  <p>I know I can make a TreeView of Strings and populate it myself with an addNode(MyObject obj) method in which I would add the individual TreeItems I need. However, I did this with a TableView where I was able to bind a column with a field property. Such as:</p>
  
  <pre><code>TableView&lt;MyObject&gt; table;
  TableColumn&lt;MyObject, String&gt; myColumn;
  myColumn.setCellValueFactory(new PropertyValueFactory&lt;&gt;("field1"));
  </code></pre>
  
  <p>Is there any way to do something similar for a <code>TreeView&lt;MyObject&gt;</code>? Im not opposed to creating a subclass that extends <code>TreeItem&lt;?&gt;</code></p>
  
  <p>The ending result I'm looking for would be something like this:</p>
  
  <pre><code>--&gt; First My Object
      -&gt;field1: "Value at Field 1"
      -&gt;field2: "Value at Field 2"
      -&gt;field3: 3
  --&gt; Second My Object
      -&gt;field1: "Value at Field 1"
      -&gt;field2: "Value at Field 2"
      -&gt;field3: 3
  </code></pre>