private static boolean isMultiline(@NotNull JComponent component) {
    return component instanceof JTextArea && ((JTextArea)component).getText().contains("\n");
  }
private static boolean isMultiline(@NotNull JComponent component)