private static @NlsSafe boolean convertMessage(@Nls String message, @NotNull JEditorPane component) {
    View v = BasicHTML.createHTMLView(component, String.format("<html>%s</html>", message));
    boolean widerText = v.getPreferredSpan(View.X_AXIS) > MAX_WIDTH.get();
    HtmlChunk.Element div =  widerText ?
                             HtmlChunk.div().attr("width", MAX_WIDTH.get()).addRaw(trimMessage(message, component))
                             : HtmlChunk.div().addRaw(message);
    component.setText(div.wrapWith("body").wrapWith("html").toString());
    return widerText;
  }
private static @NlsSafe boolean convertMessage(@Nls String message, @NotNull JEditorPane component)