Originally posted by Niels Laughlin:
I created a JPanel and put the scroller in it and then put the JPanel in a JFrame. Your suggestion to put the scroller directly in the JFrame worked.
However, I am curious as to why it worked.
When the user enlarges the frame, its BorderLayout enlarges the CENTER component. If the center component is the text area (or a scroll pane containing the text area) then it does what you want.
If you have an intermediate JPanel than it is the panel which will be enlarged. The panel's layout manager then decides if it should resize any of the components it contains. JPanel defaults to FlowLayout, which tries to keep components at their preferred sizes, so no change to the text area's size.
[ December 15, 2006: Message edited by: Brian Cole ]