1import javafx.scene.control.TextArea;
2
3TextArea textArea = new TextArea(); //making a TextArea object
4
5textArea.setPrefHeight(400); //sets height of the TextArea to 400 pixels
6textArea.setPrefWidth(300); //sets width of the TextArea to 300 pixels
1TextArea textArea = new TextArea(); //making a TexrArea object
2double height = 400; //making a variable called height with a value 400
3double width = 300; //making a variable called height with a value 300
4
5//You can use these methods
6textArea.setPrefHeight(height); //sets height of the TextArea to 400 pixels
7textArea.setPrefWidth(width); //sets width of the TextArea to 300 pixels