title: Getting column names from an AbstractTableModel
body: <p>I can't figure out something using the constructor <code>JTable(TableModel dm)</code>. </p>
  
  <p>I'm using a LinkedList to manage my data so, to display it, I extended <code>AbstractTableModel</code>:</p>
  
  <pre><code>public class VolumeListTableModel extends AbstractTableModel {
  
      private static final long serialVersionUID = 1L;
      private LinkedList&lt;Directory&gt; datalist;
      private Object[] columnNames= {"ID", "Directory", "Wildcard"};
  
  
      public VolumeListTableModel(){
      }
  
      public void setDatalist(LinkedList&lt;Directory&gt; temp){
          this.datalist = temp;
      }
  
      public LinkedList&lt;Directory&gt; getDatalist(){
          return (LinkedList&lt;Directory&gt;) this.datalist.clone();
      }
  
      public Object[] getColumnNames() {
          return this.columnNames;    
      }
  
      @Override
      public int getColumnCount() {
          return Directory.numCols;
      }
  
      @Override
      public int getRowCount() {
          return this.datalist.size();
      }
  
      @Override
      public Object getValueAt(int row, int col) {
  
          Directory temp = this.datalist.get(row);
  
          switch(col){
          case 0:
              return temp.getId();
          case 1:
              return temp.getPath();
          case 2:
              return temp.getWildcard();
          default:
              return null;        
          }
      }
  </code></pre>
  
  <p>I'm doing something wrong because when I run my GUI I get column names labeled <em>A</em>,*B*,<em>C</em>.</p>