Reputation: 421
How can I retrieve the header values from a JTable? Thanks.
Upvotes: 11
Views: 13035
Reputation: 31
It is not obvious that the Column name and the header name are the same. To get the header name: jTable1.getColumnModel().getColumn(i).getHeaderValue()
Upvotes: 3
Reputation: 14671
With the getColumnName(int)
method
jTable.getColumnName(columnIndex)
Upvotes: 9