private int contentsPreferredWidth() {
    int elementsPreferredWidth = new DocumentationPanePreferredWidthProvider(getUI().getRootView(this)).get();
    int preferredContentWidth = getPreferredContentWidth(getDocument().getLength());
    return Math.max(elementsPreferredWidth, preferredContentWidth);
  }
private int contentsPreferredWidth()