JEditorPane (@NotNull @Nls String bodyInnerHtml, @Nullable @Nls String disabledBodyInnerHtml, @Nullable Consumer<? super String> hyperlinkListener) { final Font font = StartupUiUtil.getLabelFont(); String html = buildHtml( UIUtil.getCssFontDeclaration(font, UIUtil.getActiveTextColor(), null, null), bodyInnerHtml ); String disabledHtml = buildHtml( UIUtil.getCssFontDeclaration(font, NamedColorUtil.getInactiveTextColor(), null, null), ObjectUtils.notNull(disabledBodyInnerHtml, bodyInnerHtml) ); final JEditorPane pane = new SwingHelper.HtmlViewerBuilder() .setCarryTextOver(false) .setFont(StartupUiUtil.getLabelFont()) .setDisabledHtml(disabledHtml) .create(); pane.setText(html); pane.addHyperlinkListener( new HyperlinkListener() { @Override public void hyperlinkUpdate(HyperlinkEvent e) { if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) { if (hyperlinkListener != null) hyperlinkListener.consume(e.getURL() == null ? "" : e.getURL().toString()); else BrowserUtil.browse(e.getURL()); } } } ); return pane; }