Saturday, 30 June 2012

program to demostrate used of TextField and TextArea within applet.

import java.awt.*;
import java.applet.Applet;

/* <applet code="texts" width=200 height=300>
   </applet>
*/

public class texts extends Applet
{
      public void init()
      {
            add(new TextField("Sample String ",20));
            setFont(new Font("Times Roman ",Font.ITALIC,8));
            add(new TextField("Hello Word"));
            setFont(new Font("Helvetica ",Font.BOLD,18));
            add(new TextArea("Scratch Pad on Ice ",5,20));
      }
}