Example of TextField,TextArea,Label & Button in Applet.
*Program:-
/*
<Applet code="Form" width=500 height=500>
</Applet>
*/
import java.applet.*;
import java.awt.*;
public class Form extends Applet
{
TextField t1,t2;
Label l1,l2,l3;
TextArea ta;
Button b1;
public void init()
{
l1=new Label("Name:-");
l2=new Label("Mobile:-");
l3=new Label("Address:-");
t1=new TextField(12);
t2=new TextField(10);
ta=new TextArea();
b1=new Button("Submit");
add(l1);
add(t1);
add(l2);
add(t2);
add(l3);
add(ta);
add(b1);
}
}
*Output:-
![]() |
| Tejas Nalawade |



Comments
Post a Comment