I have a LinkedHashSet containing book objects. Everytime the application is opened it reads in the objects into the LinkedHashSet from a serialized file.
I was using an iterator to run through the LinkedHashSet and output the data of each objects fields into a multidimensional array to populate my JTable, but what happens is that if I click the editable Boolean column it is updating the array and not the original object?
How can I populate the JTable so that selecting the check Box changes the field of the actual object and then fire the table to update? (the table will then need to pull in the new data as that boolean field of the object sets another field.
I recommend to implement a custom table model eg. based on a List.
Here is a List based read-only table model sample I once wrote:
http://puces-samples.svn.sourceforge.net/viewvc/puces-samples/tags/sessionstate-1.0/sessionstate-suite/sessionstate-sample/src/blogspot/puce/sessionstate/sample/ParticipantTableModel.java?revision=13&view=markup
Follow the tutorial to implement a writable table model:
http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#data