Check out example codes for "javafx textarea how to make smaller". It will help you in understanding the concepts better.

Code Example 1

import javafx.scene.control.TextArea;

TextArea textArea = new TextArea(); //making a TextArea object

textArea.setPrefHeight(400);  //sets height of the TextArea to 400 pixels 
textArea.setPrefWidth(300);    //sets width of the TextArea to 300 pixels

Learn ReactJs, React Native from akashmittal.com