Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import javax.swing.JTable;

public class Main {
    public static boolean containStringInColumn(JTable jTable, int col, String valueBuscado) {

        int num_rows = jTable.getRowCount();
        boolean resp = false;
        //iteramos la tabla
        for (int r = 0; r < num_rows; r++) {
            String valueTabla = "" + jTable.getValueAt(r, col);

            if (valueTabla.equalsIgnoreCase(valueBuscado)) {
                resp = true;
                break;
            }
        }

        return resp;
    }
}