JEditorPane with nested div overflowing with a scrollbar

31 Views Asked by At

I'm wondering if it's possible to have a JEditorPane that is able to display / render (i.e. not editable) HTML content that has a nested div of fixed size or width, and that contains bigger inner content.

In particular I'm interested in wider content, that the the JEditorPane has width. I.e. I would like this nested div to overflow on the X axis and as such show an horizontal scrollbar on this div only. The rest of the sibling content nodes of that div can be word wrapped.

example

From the HTML point of view the div, container should have the style overflow-x: auto;. In the above example the content is text, but really I'm looking at anything that is wider, e.g. a table, an image, etc.

Given Swing supports only HTML 3.2, I don't think this might be quite possible. But I may be wrong as I don't quite get yet if ViewFactory / View could be helpful there to somewhat install a JScrollPane.

Just in case, I don't want to put the whole JEditorPane in a JScrollPane.

0

There are 0 best solutions below