home *** CD-ROM | disk | FTP | other *** search
/ Java by Example / jbecd.bin / JBE-CD / NTUsers / JBECODE.ZIP / JavaByExample / chap20 / TextAreaApplet.class (.txt) < prev    next >
Encoding:
Java Class File  |  1996-03-04  |  1.1 KB  |  22 lines

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