title: Creating TreeTables in Swing
body: <p>Using this manual (<a href="http://www.comp.nus.edu.sg/~cs3283/ftp/Java/swingConnect/tech_topics/tables-trees/tables-trees.html" rel="nofollow noreferrer">http://www.comp.nus.edu.sg/~cs3283/ftp/Java/swingConnect/tech_topics/tables-trees/tables-trees.html</a>) I'm trying to create tree table for my project's Swing user interface.</p>
  
  <p>In constructor of my class for table I redefined render like this:</p>
  
  <pre><code>public class JTreeTable extends JTable {
      public JTreeTable(ITreeTableModel treeTableModel) {
          super();
          ...
          setDefaultRenderer(ITreeTableModel.class, tree); 
          ...
      }
  
  }
  </code></pre>
  
  <p>where treeTableModel is my implementation for </p>
  
  <pre><code>interface ITreeTableModel extends TreeModel
  </code></pre>
  
  <p>In result table looks near to what I want, but I have couple issues:</p>
  
  <p><img src="https://i.stack.imgur.com/vrK8K.gif" alt="enter image description here"></p>
  
  <ol>
  <li><p>Field (ID) in my code defines as Object but really it represents numbers (1,2,3 and so on). How to change representation of field ID?</p></li>
  <li><p>Nodes in my table do not expand.
  But </p>
  
  <p>public int getChildCount(Object parent_object_id)</p></li>
  </ol>
  
  <p>returns number > 0</p>
  
  <p>p.s. I know that there is maybe not enough information for direct answer, but I need at least direction in which I can to continue my investigations.</p>