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

public class Applet2 extends Applet {

public void init() {

//adding label

Label lbl=new Label("Name: "); add(lbl);

//adding textfield

TextField txt=new TextField(10); add(txt);

//adding button

Button btn=new Button("Submit"); add(btn);

}

}

Output