IntList (String s) { IntList rows = new IntArrayList(); String _s = s.trim(); for (int row = 0; row < myComponent.getRowCount(); row++) { for (int col = 0; col < myComponent.getColumnCount(); col++) { int index = row * myComponent.getColumnCount() + col; if (isMatchingElement(index, _s)) { rows.add(row); break; } } } return rows; }