home *** CD-ROM | disk | FTP | other *** search
/ Java by Example / jbecd.bin / JBE-CD / NTUsers / JBECODE.ZIP / JavaByExample / chap20 / TextAreaApplet.java < prev    next >
Text File  |  1996-03-04  |  646b  |  25 lines

  1. import java.awt.*;
  2. import java.applet.*;
  3.  
  4. public class TextAreaApplet extends Applet
  5. {
  6.     TextArea textArea;
  7.  
  8.     public void init()
  9.     {
  10.         String s = "This is an example of a\n";
  11.         s += "textarea control, which is not\n";
  12.         s += "unlike a textfield control.\n";
  13.         s += "The big difference is that a\n";
  14.         s += "textarea control can hold many\n";
  15.         s += "lines of text, whereas a\n";
  16.         s += "textfield control deals with\n";
  17.         s += "only one line of text at a time.\n";
  18.  
  19.         textArea = new TextArea(s, 9, 30);
  20.         add(textArea);
  21.  
  22.         resize(300, 180);
  23.     }
  24. }
  25.