In all the examples that I can find that use a JTextArea, the height & width is known before constructing the JTextArea, and if the JText
it uses absolute positioning based on the added component's preferred size.
Sounds like the job of a layout manager.
This requires that my JTextArea would return the correct dimensions on getPreferredSize().
JTextArea textArea = new JTextArea();
textArea.setLineWrap( true );
textArea.setWrapStyleWord( true );
textArea.setText("one two three four five six seven eight nine ten");
System.out.println("000: " + textArea.getPreferredSize());
textArea.setSize(100, 1);
System.out.println("100: " + textArea.getPreferredSize());
textArea.setSize( textArea.getPreferredSize() );