Here you can find the source of getRowByValue(TableModel model, Object value)
public static int getRowByValue(TableModel model, 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 ww w. jav a2 s .c om } } 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; } }