1 | A TextArea is a mult-line TextField. |
2 | Like TextFields, you can use the methods getText and setText on TextAreas. |
3 | Unlike TextFields, TextAreas do not generate ActionEvents, since pressing enter inserts a newline into the text (i.e. the cursor goes to the next line). |
4 | When writing Strings into a TextArea with the setText method, you must explicitly put newlines into the String to put text on different lines: TextArea ta = new TextArea ( 5, 60 ) ; ta.setText ( "The first line, \n the second line." ) ; |
5 | The TextArea above is created with room for 5 lines of text, each of 60 characters long. |