posted 19 years ago
Hi,
I have a JScrollPane that contains a JPanel that contains a JEditorPane. So it's a bit like this:
|--------------------
|JScrollPane
| |------------------
| |JPanel
| | |----------------
| | |JEditorPane
| | |
The reason for this is because the JPanel also contains some other controls.
The difficulty I'm having is that the JEditorPane isn't wrapping the text as it is unconstrained by width (because of the scrollpane). So as a result, each paragraph in the HTML is shown as a single, very long, very wide line.
Is there any way to tell Swing to contrict the width of the JPanel to the size of the JScrollPane viewport?
Any ideas how to get around this problem? If I drop the editorpane into a scrollpane, everything works fine.
Any help is much appreciated.
Cheers,
Steve