By default there are some issues with long text displaying in html page loaded into JEditorPane.
- content of the pre-blocks is not wrapped at all;
- long like super long word or symbol seqence is not wrapped anywhere.
One extra issue: how to wrap a text in JEditorPane inside JScrollPane if we don't need to use horizontal scroll bar?
Let's start from the ending:
- just override method JEditorPane.getScrollableTracksViewportWidth and put "return true;" inside.
For the first two issues we need to override classes javax.swing.text.html.HTMLEditorKit and javax.swing.text.html.ParagraphView.
Our HTMLEditorKit should just return an object of our ParagraphView for specific tags.
Custom ParagraphView should return 0 in the method getMinimumSpan for X-axis.
BTW, HTMLEditorKit implements HTML spec ver. 3.2. The specification is from as early as 1997: