Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.swing.table.TableColumnModel;

public class Main {
    public static int getIndexAtColumnModel(TableColumnModel model, String name) {
        for (int i = 0; i < model.getColumnCount(); i++) {
            String headStr = model.getColumn(i).getHeaderValue().toString();

            if (name.equals(headStr)) {
                return i;
            }
        }
        return 0;
    }
}