TextField

A scrollable text display object with one row of characters is known as the TextField. In the example given below, shown a textfield in the applet by creating its textfield.shtml object.

TextField

     

A scrollable text display object with one row of characters is known as the TextField. In the example given below, shown a textfield in the applet by creating its <<<<<<< textfield.shtml object.

 

 

======= object.

>>>>>>> 1.2
import java.awt.*; 
import java.applet.Applet; 
 
public class TextFieldDemo extends Applet{ 
  public void init(){ 
  TextField tf = new TextField("Type in the box"); 
  add(tf); 
  


Here is the output:
 

C:\newprgrm>javac TextFieldDemo.java

C:\newprgrm>appletviewer TextFieldDemo.html

 

Download this example.