public void addColumn(String header){
  if (getModel() instanceof DefaultTableModel) {
    DefaultTableModel model=(DefaultTableModel)getModel();
    model.addColumn(Util.cleanAmp(header));
  }
 else   throw new IllegalArgumentException("Model must be instance of DefaultTableModel");
}

public void addColumn ( String header ) { if ( getModel ( ) instanceof DefaultTableModel ) { DefaultTableModel model = ( DefaultTableModel ) getModel ( ) ; model . addColumn ( Util . cleanAmp ( header ) ) ; } else throw new IllegalArgumentException ( "Model must be instance of DefaultTableModel" ) ; }
add table column . after adding a column , you need to set the column classes again ( defaulttablemodel fires tablestructurechanged , which calls jtable . tablechanged . . createdefaultcolumnsfrommodel
