Example #1
0
    public void actionPerformed(ActionEvent e) {
      boolean state = ((Boolean) getValue(BAMutil.STATE)).booleanValue();
      TableColumnModel tcm = table.getColumnModel();

      if (state) {
        if (tc != null) tcm.addColumn(tc);
      } else hideColumn();

      JTreeTableSorted.this.revalidate();
      // System.out.println(id+" "+state);
    }
Example #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);
      }
    }
Example #3
0
 private TableColumnModel getTableColumnModel() {
   TableColumnModel tcm = new DefaultTableColumnModel();
   tcm.addColumn(genColumn(0, 100, "Word"));
   tcm.addColumn(genColumn(1, 400, "Clue"));
   return tcm;
 }