Apologies if this is slightly off topic but here we go:
I have a JFrame with with a tabbedpane inside it. One tab has a JPanel
containing 4 JScrollPanes each of which has a JEditorPane inside - see
On first loading the app the 4 JEditorPanes are each perfectly stretched to
fill an even space on the panel. But for some reason when I import a large
amount of text into any of them - using jpanel.setText(large amount of text)
the editor stretches out pushing all of the second row of items down - see
image2.jpg. I expected the JEditorPane to gain scrollbars and not resize
when filling up with text?
Any ideas on how to enforce the same size for the JEditorPanes but add
scrollbars when needed would be happily recieved? I have set the scrollbars
policy of the underlying JScrollPanes to 'As Needed' and this has no
effect - sometimes scrollbars are added but the pane is still expanded
pushing everything else aside?