JLabel (@NotNull JLabel label) { label.setIcon(myIcon); synchronized (myFragments) { if (!myFragments.isEmpty()) { @Nls StringBuilder sb = new StringBuilder(); sb.append("<html><body style=\"white-space:nowrap\">"); for (ColoredFragment fragment : myFragments) { final String text = fragment.text; final SimpleTextAttributes attributes = fragment.attributes; final Object tag = fragment.tag; if (tag instanceof BrowserLauncherTag) { formatLink(sb, text, attributes, ((BrowserLauncherTag)tag).myUrl); } else { formatText(sb, text, attributes); } } sb.append("</body></html>"); label.setText(sb.toString()); } } return label; }