public static void sortColumnsInOrder(ColumnLayout columnLayout, JTable table) {
    final List<String> columns = columnLayout.getColumns();
    for (int i = 0; i < columns.size(); i++) {
      final int index = findColumnIndexByHeader(table.getColumnModel(), columns.get(i));
      if (index > -1) {
        LOGGER.info("Moving " + index + " to " + i);
        table.moveColumn(index, i);
      }
    }
  }
Find column index by it's name

@param columnModel column model
@param columnName  column name to find
@return column index or -1 if not found
olv-gui/src/main/java/pl/otros/swing/table/TablesUtils.java