But what if I want to make it so that the Object is not stored inside AbstractTableModel
The Object should always be stored inside the TableModel. You can create the Object externally but then you need to add the Object to the TableModel. Once the Object is part of the model you should only manipulate it through the TableModel methods.
See the Row Table Model for a TableModel that will allow you to store Objects in the model but allow you to retrieve the data as a complete Object if you desire.
You will need to extend the class to implement your own getValueAt()
and setValueAt()
methods. These methods will access individual properties of your Object. The JButtonTableModel.java example shows how you can do this.