This discussion is archived
1 Reply Latest reply: Aug 8, 2011 9:36 AM by 801313 RSS

JTables inside a JTable

877202 Newbie
Currently Being Moderated
Hi,
I have designed a Table (call it as MainTable) using swing JTable where each cell in this Table is rendered using a JTable(subTable1) with n columns and 1 row and the subTable1'srendering component is also a JTable(subTable2) with n columns and 1 row and this tables... (goes on). The depth of these subTable for a given Cell varies from 0 to n. All the tables have their own TableModel.

As mentioned the row count of the subtable is always 1 and hence getValueAt and setValueAt functions are always called with rowIndex 1 which is trivial. Instead I need the rowIndex of the mainTable for which this subtable is used as rendering component.

Does anyone know how this can be done?

Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points