Factory<JComponent> (@NlsContexts.Label String text, final boolean isError) { return () -> { JLabel label = new JBLabel(StringUtil.replace(text.trim(), "\n", UIUtil.BR)).setCopyable(true); label.setVerticalTextPosition(SwingConstants.TOP); label.setBorder(JBUI.Borders.empty(3)); label.setForeground(isError ? JBColor.RED : UIUtil.getLabelForeground()); return label; }; }