Im trying to serialise objects(Names and notes) which I store in my JTable. I want to be able to save this information to a file and when I load the program, the information sho
You appear to be doing things backwards. i.e.,
Also, unrelated but I feel important advice:
null
layout and calling setBounds(...)
on your components to place them with absolute positioning as this makes for very inflexible GUI's that while they might look good on one platform look terrible on most other platforms or screen resolutions and that are very difficult to update and maintain. Instead you will want to study and learn the layout managers and then nest JPanels, each using its own layout manager to create pleasing and complex GUI's that look good on all OS's.java.util.List
class. Edit
You ask in comment:
So once the data has been entered into the JTable, it should be transfered to the list object before serialization? How would I go about doing this?
What I would do would be to get rid of the List class entirely, I would pass the Table's model into my serialize method, I would call getDataVector()
on my DefaultTableModel object to extract its nucleus, and I would serialize that.
When de-serializing, I'd do the opposite -- read in the Vector from the disk and create a new DefaultTableModel object from it, from a Vector<String>
that holds the table's column headings. As for the code details, well that's for you to work out.