I would like to create a table with the constructor method JTable(TableModel). What exact methods in the TableModel do I need to display the titles of each column?
You need to embed your JTable
within a JScrollPane
and the column headings will be shown automatically:
JScrollPane sp = new JScrollPane(new JTable());