Hello Java programmers. I have a game that I am working on, and I am at the stage where I am displaying the player's game history. I am using a JTable and an AbstractTableModel. The thing is, however, that I have the AbstractTableModel defined in a different Java file than the JTable is. The JTable is, in fact, defined in its own class. My JTable will display, but it doesn't have the columnNames displayed even though I explicitly defined them in the AbstractTableModel and overrode a method for displaying their names. Is it possible for me to display the column names in the JTable with my code the way it is? I am using
as constructor for JTable. Here, I included all of the GameHistoryTable(), so that you can see me giving the AbstractTableModel as parameter.
public GameHistoryTable(GameHistoryTableModel m) { //Set up the table here. table = new JTable(m); table.setPreferredScrollableViewportSize(new Dimension(800,120)); }
as constructor for JTable. Here, I included all of the GameHistoryTable(), so that you can see me giving the AbstractTableModel as parameter.