List of usage examples for javax.swing.table TableColumnModel getColumnIndex
public int getColumnIndex(Object columnIdentifier);
identifier
, when compared using equals
. From source file:edu.ku.brc.af.ui.forms.formatters.DataObjFieldFormatMultiplePanel.java
/** * /* w ww . j av a 2s. c o m*/ */ private void setFormatSwitchTblColumnProperties() { // set details of 1st column (field values) TableColumnModel model = formatSwitchTbl.getColumnModel(); TableColumn column = model.getColumn(model.getColumnIndex(FIELD_VALUE_COL)); column.setMinWidth(20); column.setMaxWidth(300); column.setPreferredWidth(70); DefaultTableCellRenderer renderer = new DefaultTableCellRenderer(); renderer.setHorizontalAlignment(SwingConstants.CENTER); column.setCellRenderer(renderer); // set details of 3rd column (ellipsis buttons) column = model.getColumn(model.getColumnIndex(ELLIPSIS_BUTTON_COL)); column.setCellRenderer(new EditDataObjFormatButtonRenderer()); column.setCellEditor(new EditDataObjFormatButtonEditor(createCheckBox())); column.setMinWidth(20); column.setMaxWidth(20); column.setPreferredWidth(20); }