how to change JTable column header text
RichFDec 9 2010 — edited Dec 9 2010How do you set the text in the JTable column headers? I know you can create a JTable specifying the text in an array:
<li>JTable(Object[][] rowData, Object[] columnNames)
But if you create the JTable specifying a TableModel,
<li>JTable(TableModel dm)
the header text defaults to "A", "B", "C", etc. I cannot figure out how to access the text in the header names so it can be changed to something useful. I know how to get the JTableHeader for the table, but it does not seem to have methods for actually setting header values.