JComponent () { final JEditorPane messagePane = new JEditorPane(UIUtil.HTML_MIME, ""); messagePane.setEditorKit(HTMLEditorKitBuilder.simple()); messagePane.setEditable(false); messagePane.setMargin(JBUI.insets(5)); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane); scrollPane.setPreferredSize(JBUI.size(500, 400)); JPanel panel = UI.PanelFactory.panel(scrollPane) .withLabel(RefactoringBundle.message("the.following.problems.were.found")) .moveLabelOnTop() .resizeY(true) .createPanel(); HtmlBuilder builder = new HtmlBuilder(); for (@Nls String conflictDescription : myConflictDescriptions) { builder.appendRaw(conflictDescription).br().br(); } String text = builder.wrapWithHtmlBody().toString(); messagePane.setText(text); return panel; }