title: Render a JTable for specifc cells inside of another JTable
body: <p>I am trying to render JTables in the cells of an outer JTable. The <code>ALLYTIPS</code>, <code>ENEMYTIPS</code>, <code>STATS</code>, <code>SPELLS</code>, and <code>PASSIVE</code> rows will all have JTables for their corresponding <code>Value</code> (the name of the column) cell.</p>
  <p>Here is what the outer JTable currently looks like:</p>
  <p><a href="https://i.stack.imgur.com/AOocp.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AOocp.png" alt="Here is what the outer JTable currently looks like" /></a></p>
  <p>What is the best way to render JTables for these cells? I created a custom <code>TableCellRenderer</code> that overrides <code>getTableCellRendererComponent</code>which looks like this:</p>
  <pre><code>public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
          Component component = null;
          if(column == 1) {
              switch(row) {
                  case 3: case 4: {
                      List&lt;String&gt; tips = (List)value;
                      TipsTableModel tableModel = new TipsTableModel(tips);
                      component = new JTable(tableModel);
                      break;
                  }
                  case 5: {
                      ChampionStats stats = (ChampionStats)value;
                      StatsTableModel tableModel = new StatsTableModel(stats);
                      component = new JTable(tableModel);
                      break;
                  }
                  case 6: {
                      HashMap&lt;String, ChampionSpell&gt; spells = (HashMap)value;
                      SpellsTableModel tableModel = new SpellsTableModel(spells);
                      component = new JTable(tableModel);
                      break;
                  }
                  case 7: {
                      String[] passive = (String[])value;
                      PassiveTableModel tableModel = new PassiveTableModel(passive);
                      component = new JTable(tableModel);
                      break;
                  }
                  default: component = null;
              }
          }
          return component;
      }
  </code></pre>
  <p>and the code for the outer table that sets the <code>TableCellRenderer</code> for each cell:</p>
  <pre><code>for(int i = 0; i &lt; championTableInfo.getRowCount(); i++) {
                  Object value = championTableInfo.getValueAt(i, 1);
                  javax.swing.JTable cell = (javax.swing.JTable)renderer.getTableCellRendererComponent(championTableInfo, value, false, false, i, 1);
                  championTableInfo.setValueAt(cell, i, 1);
              }
  </code></pre>
  <p>which does nothing.</p>
  <p>I have custom <code>TableModel</code>s for each of the objects in the cells for which I want to render JTables.</p>
  <p>It looks like I may need to use <code>getCellRenderer</code> on the outer <code>JTable</code> object but I'm not exactly sure how to do that. Or do I need to render the cell directly in the <code>getValueAt</code> method of the <code>TableModel</code> of the outer JTable?</p>