Code example for JTextComponent

Methods: getText

0
   * @return {@code true} if the given {@code JTextComponent} displays the given text; {@code false} otherwise. 
   */ 
  @RunsInCurrentThread 
  @Override 
  protected boolean checkContainsText(@Nonnull JTextComponent textComponent, @Nonnull String text) {
    String componentText = textComponent.getText();
    if (componentText == null) {
      return false; 
    } 
    return componentText.contains(text);
  } 
} 
Experience pair programming with AI  Get Codota for Java