Hello. I am attempting to create my own custom TableModel for my JTable (because I would like to incorporate a row of JCheckBox's into my table.) I have the JTable in a JScrollPane as well. Before I attempted to incorporate the JCheckBox and custom AbstractTableModel, the JTable would show up fine if I used the default (Object[][], Object[]) constructor. I read in the JTable tutorial on Sun that those constructors use a default of treating all data as Strings.
I then created my custom AbstractTableModel and went from this:
JTable table = new JTable(dataArray, col);
To This:
JTable table = new JTable();
I am assuming that this would call attempt to create the JTable with the custom-made class that extends AbstractTableModel, but now nothing shows up in the JScrollPane.
I am using this incorrectly? I virtually copied the code from the Sun tutorial and only changed the names of the datafiles involved. I also placed this method in the same class. Is there a different way to make sure that your table is created with your custom Table Model? Any insight would appreciated. Thank you for your time.