Beispiel #1
0
 public void hideColumn() {
   // System.out.println("hideColumn "+id);
   TableColumnModel tcm = table.getColumnModel();
   try {
     int idx = tcm.getColumnIndex(id);
     tc = tcm.getColumn(idx);
     tcm.removeColumn(tc);
   } catch (Exception e) {
     // System.out.println("hideColumn didnt find"+id);
   }
 }
Beispiel #2
0
    public void addAtPos(int pos) {
      if (tc == null) return;

      TableColumnModel tcm = table.getColumnModel();

      // make sure it doesnt already exist
      try {
        tcm.addColumn(tc);
        int idx = tcm.getColumnIndex(id);
        tcm.moveColumn(idx, 0);
      } catch (Exception e) {
        System.out.println("addAtPos failed" + e);
      }
    }