Basic HTML version of Foils prepared March 26 1999

Foil 8 TextAreas

From Java Academy:Graphical User Interface NPAC Java Academy February--April 99 -- March 1999. by Nancy McCracken


A TextArea is a mult-line TextField.
Like TextFields, you can use the methods getText and setText on TextAreas.
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).
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." ) ;
The TextArea above is created with room for 5 lines of text, each of 60 characters long.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Mar 26 1999