import java.awt.*;
import java.applet.*;
public class ComponentDemo extends Applet
{
//Declaring AWT Components
TextField txtfield;
TextArea txtarea;
Button btn;
Label name;
Label about;
//Applets init method
public void init()
{
//Creating AWT components
txtfield = new TextField();
txtarea = new TextArea();
btn = new Button("Submit");
name = new Label("Name Please");
about = new Label("About Yourself");
//Adding AWT components to container
setLayout(new GridLayout(3,2));
add(name);
add(txtfield);
add(about);
add(txtarea);
add(btn);
}
}
import java.applet.*;
public class ComponentDemo extends Applet
{
//Declaring AWT Components
TextField txtfield;
TextArea txtarea;
Button btn;
Label name;
Label about;
//Applets init method
public void init()
{
//Creating AWT components
txtfield = new TextField();
txtarea = new TextArea();
btn = new Button("Submit");
name = new Label("Name Please");
about = new Label("About Yourself");
//Adding AWT components to container
setLayout(new GridLayout(3,2));
add(name);
add(txtfield);
add(about);
add(txtarea);
add(btn);
}
}