I have a JTable inside a JScrollPane which, in turn, is inside a JTabbedPane.
I created a TableModel which extends AbstractTableModel as per the java Swing Tutorial examples.
In that model is an Object[][] object for the data called rowData, and all the data displays in the table perfectly.
I also have a String[] object called columnNames to define the column headers. ..the column names are coded directly into the object.
i.e.:
String[] columnNames = {"John", "Janet", "Jamie", "Jennifer"};
But the column names don't display at all.....all I get in the column headers is 'A', 'B', 'C', etc.
I need to know either
1)how to set this up correctly in the first place or
2)how I can reset the columns manually.
I have tried adding the table 2 ways..as follows...but neither one gets the headers right:
JScrollPane jScrollPane = new javax.swing.JScrollPane(getTable());
or
JScrollPane jScrollPane.setViewportView(getTable());
Note: getTable()..is where the
new javax.swing.JTabel(new TableModel())
stuff is done.
thx, ESW