Hello,
Can someone help me get a clear understanding of JTables.
I have a TestRecord class which creates TestRecords
I have an application which displays the table and creates some TestRecords
I have a table model...
The table model is a mess because I began with the record data being stored as a vector but (and here is where I am confused) this seemed to make the actual record object itself redundant.
I admit to being a
java beginner however I thought that one of the key activities was to abstract things (in this case a record) into classes and objects (in this case a TestRecord class that creates TestRecord objects).
It makes sense to me to store these TestRecord objects into a vector as they are created, but I dont understand how to get the Table Model to use this vector of stored TestRecord objects. I understand how to get and set the fields within each TestRecord object (as the above code shows) and I can see a possible link between the objects data and its display in the table...
Table rows link to objects in vector
Table columns link to fields in object
... but I have no idea how to...
A) make the Table Model handle the display of the object data in this way
B) whether I am wasting my time as Table Models (and JTables) simply do not work this way
I think there is something about JTables, Table Models and (in this case) the TestRecord objects they display, that I have not grasped and if someone could help clear this up for me then I would be really grateful.
Thank you.
Darren