public void testColumModelRendering() {
Label label;
DefaultTableModel model = createEmployeeTableModel();
Table table = new Table(model);
DefaultTableColumnModel columnModel = (DefaultTableColumnModel) table.getColumnModel();
assertEquals(0, columnModel.getColumn(0).getModelIndex());
assertEquals(1, columnModel.getColumn(1).getModelIndex());
assertEquals(2, columnModel.getColumn(2).getModelIndex());
table.setAutoCreateColumnsFromModel(false);
table.validate();
label = (Label) table.getComponent(4);
assertEquals("32", label.getText());
label = (Label) table.getComponent(5);
assertEquals("true", label.getText());
columnModel.getColumn(2).setModelIndex(1);
columnModel.getColumn(1).setModelIndex(2);
table.setColumnModel(columnModel);
table.validate();
// Indices should switch.
label = (Label) table.getComponent(4);