TextArea and TextField are nearly identical except for one rather obvious difference: A textarea provides more than one row of text, while a textfield provides only a single line of text. TextArea, like TextField, is quite generous about providing ample constructors to choose from.
TextArea(int rows, int cols)
TextArea(String s, int rows, int cols)
TextArea(String s, int rows, int cols, int scrollbarPolicy)
Of course, if you really want the textarea to be sized precisely, you should set the textarea's font to monospaced, as we advised for textareas.
The scrollbar policy passed to the last constructor listed must be one of the following: