code: void doFindNext()
      {
          String query = searchPanel.getQuery();
          if (query.isEmpty())
          {
              return;
          }
          
          String text = getDocumentText();
          boolean ignoreCase = !searchPanel.isCaseSensitive();
  
          int caretPosition = textComponent.getCaretPosition();
          int textLength = text.length();
          int newCaretPosition = (caretPosition + 1) % textLength;
          Point match = JTextComponents.findNext(
              text, query, newCaretPosition, ignoreCase);
          if (match == null)
          {
              match = JTextComponents.findNext(
                  text, query, 0, ignoreCase);
          }
          handleMatch(match);
      }
docs: Find the next appearance of the search panel query