Well, if you are using complex Object in your TableModel then the easiest way is probably to Serialize the TableModel. Problems with serializing is that the output file is rather large and the serialized file can only be read in by the same version of Java. (ie. its not portable between JDK1.4 and JDK1.5). This posting gives a simple example of using serialization:
http://forum.java.sun.com/thread.jspa?forumID=57&threadID=700384
If you are just saving text Strings then you could create your own simple file structure to store the data and then parse it when you load the file. Use a structure like this:
heading1|heading2|heading3|
column1|column2|column3
If you really want to solve the problem yourself then this posting was my attempt at explaining this process in a little more detail:
http://forum.java.sun.com/thread.jspa?threadID=700031
And if you want to see the final result of suggested solution from above check out:
http://forum.java.sun.com/thread.jspa?threadID=700456
Hey. Ive beenn working on it and I figure I can do it myself. only 1 problem remains..
this is my code:
http://pastebin.com/517367
(I use pastebin for else this would be a very long post)
as you can see I recently added a sorter. which makes my TableModel static or non static?!? anyway, by this I can not use getRowCount();
If you can please look over it and see if there is a way to get a rowcount. cause that would be.. basically all I need to finish it.