relatively self explanatory, I have a JTable (table) and the DefaultTableModel (model). I would like to save the contents of the JTable to a file, then read them into the JTable at a later time. How can i do this?
More Details: the JTable contains short strings, and there shouldn’t be more than, say 50KB of data toal.
DefaultTableModelimplements Serializable. So the simplest solution would be to use anObjectOutputStreamand to callwriteObject()with your model.Note: Remember that objects which are hold by the
DefaultDataModelneeds to beSerialazable