the following is the code i am using to set up a JTextArea within a JScrollPane:

private void setupOutputScrollPane() {
final int rows = 10, columns = 10;
outputTextArea = new JTextArea(rows, columns);
outputTextArea.setWrapStyleWord(true);
outputTextArea.setLineWrap(true);
outputTextArea.setEditable(false);

outputScrollPane = new JScrollPane(outputTextArea);
outputScrollPane.setHorizontalScrollBarPolicy(outputScrollPane.HORIZONTAL_SCROLLBAR_NEVER) ;
outputScrollPane.setVerticalScrollBarPolicy(outputScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED) ;
}

after this i use the JFrame's getContentPane() method to retrieve the content pane of the frame, then use the content panes add() method to add the above JScrollPane. However every time i add it, the pane is at the minimum possible size - ie just big enough to fit the up and down buttons on its scroll bar - not nearly big enough to fit the rows and columns of the JTextArea...

i am using a grid bag layout and have tried using various sets of constraints in case it helps, but no difference. I have also tried setting the size, and preffered size of both the JTextArea and the JScrollPane, but still no difference....

what am i doing wrong!?!? how can i control the size of the JScrollPane?