Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import javax.swing.JTable;
import javax.swing.table.TableColumn;

public class Main {
    public static void main(String[] argv) throws Exception {
    }

    public int toView(JTable table, int mColIndex) {
        for (int c = 0; c < table.getColumnCount(); c++) {
            TableColumn col = table.getColumnModel().getColumn(c);
            if (col.getModelIndex() == mColIndex) {
                return c;
            }
        }
        return -1;
    }
}