Sunday, July 3, 2011

Implementing getColumnName

The getColumnName method returns the name of the specified column. The JTable class uses this method to label each of its columns.

  public String getColumnName(int column) {     try {       return this.metadata.getColumnLabel(column + 1);     } catch (SQLException e) {       return e.toString();     }   }

No comments:

Post a Comment