public boolean isMultiline(JTextComponent component) {
      return component.getText().contains("\n")
             || (component instanceof JTextArea && ((JTextArea) component).getLineWrap());
    }
public boolean isMultiline(JTextComponent component)