title: JavaFX TreeView of multiple object types? (and more)
body: <p>I currently have the following object data structure: </p>
  
  <p><strong>Item</strong></p>
  
  <ul>
  <li>String name</li>
  <li>ArrayList of information</li>
  </ul>
  
  <p><strong>Character</strong></p>
  
  <ul>
  <li>String name</li>
  <li>Collection of <strong>Item</strong></li>
  </ul>
  
  <p><strong>Account</strong></p>
  
  <ul>
  <li>String name</li>
  <li>Collection of <strong>Character</strong> (up to 8 max)</li>
  </ul>
  
  <p>I want to make a TreeView that looks like the following:</p>
  
  <pre><code>Root(invisible)
  ======Jake(Account)
  ============JakesChar(Character)
  ==================Amazing Sword(Item)
  ==================Broken Bow(Item)
  ==================Junk Metal(Item)
  ======Mark(Account)
  ============myChar(Character)
  ==================Godly Axe(Item)
  ======FreshAcc(Account)
  ======MarksAltAcc(Account)
  ============IllLvlThisIPromise(Character)
  ======Jeffrey(Account)
  ============Jeff(Character)
  ==================Super Gun(Item)
  ==================Better Super Gun(Item)
  ==================Super Gun Scope(Item)
  </code></pre>
  
  <p>I made all those names up and such, obviously the real implementation would be a lot more complex. How can this be done? The TreeItem requires each TreeItem to be the same type as its' parent. </p>
  
  <p>The ONLY solution I have is to do the following:</p>
  
  <pre><code>public class ObjectPointer
  {
      Object pointer;
      String name;
  }
  </code></pre>
  
  <p>My TreeView would be of type <code>ObjectPointer</code> and on each row I would cast the <code>ObjectPointer</code> to <code>Account</code>, <code>Character,</code> or <code>Item</code>. This is AWFUL but I think it would work. </p>
  
  <p><strong>Sub Questions:</strong></p>
  
  <ul>
  <li><p>How do I get <code>TreeItem</code>(s) to detect <code>setOnMouseHover</code> events?</p></li>
  <li><p>How do I get <code>TreeItem</code>(s) to not use the <code>toString</code> method of their type and instead a custom way of displaying the <code>String</code> property that they need?</p></li>
  <li><p>How do I get the <code>TreeItem</code>(s) to display colored text in the GUI instead of plain text?</p></li>
  </ul>
  
  <p>Thank you!</p>