public boolean search(final String searchText) {
    final int nrOfColumns = m_Table.getModel().getColumnCount();
    final int nrOfRows = m_Table.getRowCount();
    for (int row = 0; row < nrOfRows; ++row) {
      for (int column = 0; column < nrOfColumns; ++column) {
        final Object cell = m_Table.getModel().getValueAt((row + m_StartRow) % nrOfRows, column);
        final String text = cell != null ? cell.toString() : "";
        // TODO make this a config option, i.e. search case sensitive
        if (text.toLowerCase().contains(searchText.toLowerCase())) {
          m_StartRow = (row + m_StartRow) % nrOfRows;
          m_Table.setRowSelectionInterval(m_StartRow, m_StartRow);
          m_Table.scrollRectToVisible(m_Table.getCellRect(m_StartRow, 0, true));
          ++m_StartRow;

          return true;
        }
      }
    }

    return false;
  }
Extends a popup menu of a JTable component with a Search menu.

@param frame the parent frame that is used as the parent frame of the input box.
@param windowTitle the title of the input box
@param table the table to search through
java/zylib/src/main/java/com/google/security/zynamics/zylib/gui/tables/CTableSearcher.java