From the sounds of it, you've added you textarea directly to your container without first adding it to a scrollpane.
The text area will grow as the content exceeds its current width/height.
Try adding your text area to a scroll pane and then add the scroll pane to your container...
textArea = new JTextArea(...)(
JScrollPane scrollPane = new JScrollPane(textArea);
add(scrollPane);
Take a look at How to use scroll panes and How to use text areas for more details