G
G.Schiber
I have an array of JTables declared as:
JTable[] tableEntity = new JTable[maxMapEntities];
and instantiated as:
for (int i=0; i < maxMapEntities; i++)
tableEntity = new JTable(tableData,tableColumns);
My gui is a map where I place entities. Each newly placed entity
increments an intEntityID by 1 and this is also used as the index in
the tableEntity array (index 0 is never used nor does it have to be).
When the user selects an entity and places it on the map(where the
mouse is clicked), I display a dialog which contains a JScrollPane
which contains the appropriate table. The code to do this is as
follows:
entityTableScroll = new JScrollPane(tableEntity[intEntityID]);
objsDialog.setContentPane(orderContainer);
objsDialog.getContentPane().add(entityTableScroll);
I have debugged and the intEntityID variable is being incremented
properly for each new entity placed on the map.
MY PROBLEM IS that a new blank tableEntity[] should be displayed for
each new entity but the previous tableEntity[]'s data is always
displayed. And when I save the data, each entity always has the same
data even though on the screen for that entity the data is different.
Any one else had a similar problem?
Thanks a lot,
Greg
JTable[] tableEntity = new JTable[maxMapEntities];
and instantiated as:
for (int i=0; i < maxMapEntities; i++)
tableEntity = new JTable(tableData,tableColumns);
My gui is a map where I place entities. Each newly placed entity
increments an intEntityID by 1 and this is also used as the index in
the tableEntity array (index 0 is never used nor does it have to be).
When the user selects an entity and places it on the map(where the
mouse is clicked), I display a dialog which contains a JScrollPane
which contains the appropriate table. The code to do this is as
follows:
entityTableScroll = new JScrollPane(tableEntity[intEntityID]);
objsDialog.setContentPane(orderContainer);
objsDialog.getContentPane().add(entityTableScroll);
I have debugged and the intEntityID variable is being incremented
properly for each new entity placed on the map.
MY PROBLEM IS that a new blank tableEntity[] should be displayed for
each new entity but the previous tableEntity[]'s data is always
displayed. And when I save the data, each entity always has the same
data even though on the screen for that entity the data is different.
Any one else had a similar problem?
Thanks a lot,
Greg