Here you can find the source of getRowByValue(TableModel model, int columnIndex, Object value)
public static Integer getRowByValue(TableModel model, int columnIndex, Object value)
//package com.java2s; //License from project: Open Source License import javax.swing.table.TableModel; public class Main { public static int getRowByValue(TableModel model, Object value) { for (int i = model.getRowCount() - 1; i >= 0; --i) { for (int j = model.getColumnCount() - 1; j >= 0; --j) { if (model.getValueAt(i, j).equals(value)) { // what if value is not unique? return i; }//from w w w . j av a2 s. co m } } return 0; } public static Integer getRowByValue(TableModel model, int columnIndex, Object value) { for (int i = model.getRowCount() - 1; i >= 0; --i) { if (model.getValueAt(i, columnIndex).equals(value)) { return i; } } return null; } }