JComponent () { JPanel panel = new JPanel(new BorderLayout(0, 2)); panel.add(new JLabel(RefactoringBundle.message("the.following.problems.were.found")), BorderLayout.NORTH); HtmlBuilder buf = new HtmlBuilder(); for (int i = 0; i < Math.min(myConflictDescriptions.length, MAX_CONFLICTS_SHOWN); i++) { buf.appendRaw(myConflictDescriptions[i]).br().br(); } if (myConflictDescriptions.length > MAX_CONFLICTS_SHOWN) { buf.appendLink(EXPAND_LINK, RefactoringBundle.message("show.more.conflicts.link")); } JEditorPane messagePane = new JEditorPane(); messagePane.setEditorKit(HTMLEditorKitBuilder.simple()); messagePane.setText(buf.toString()); messagePane.setEditable(false); JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(messagePane, ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setPreferredSize(JBUI.size(500, 400)); messagePane.addHyperlinkListener(e -> { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED && EXPAND_LINK.equals(e.getDescription())) { messagePane.setText(StringUtil.join(myConflictDescriptions, "<br><br>")); } }); panel.add(scrollPane, BorderLayout.CENTER); if (getOKAction().isEnabled()) { panel.add(new JLabel(RefactoringBundle.message("do.you.wish.to.ignore.them.and.continue")), BorderLayout.SOUTH); } return panel; }