Creating Registration Form

 CODE-

import java.awt.*;

class assign 

{

assign()

{

//Creating Frame Object

Frame f1 = new Frame("Registration Form");


//Creating Controls Object

Label l1 = new Label("Enter Your Name:"); 

TextField t1 = new TextField();


Label l2 = new Label("Enter Your Email:");

TextField t2 =new TextField();


Label l3 = new Label("Enter Your Mobile:");

TextField t3 =new TextField();


Label l4 = new Label("Course:");

Checkbox  c1 = new Checkbox("MCA");

Checkbox  c2 = new Checkbox("BCA");

Checkbox  c3 = new Checkbox("B.Sc");


Label l5 = new Label("Message:"); 

TextArea ta1 = new TextArea("Write Here..");


//Set the property of controls

l1.setBounds(30,50,100,20);

t1.setBounds(150,50,100,20);


l2.setBounds(30,80,100,20);

t2.setBounds(150,80,100,20);


l3.setBounds(30,110,100,20);

t3.setBounds(150,110,100,20);


l4.setBounds(30,140,100,20);

c1.setBounds(150,140,100,20);

c2.setBounds(150,160,100,20);

c3.setBounds(150,180,100,20);


l5.setBounds(30,220,100,20);

ta1.setBounds(150,220,100,100);


//Adding controls to frame

f1.add(l1);

f1.add(t1);


f1.add(l2);

f1.add(t2);


f1.add(l3);

f1.add(t3);


f1.add(l4);

f1.add(c1);

f1.add(c2);

f1.add(c3); 


f1.add(l5);

f1.add(ta1);


//Setting the functions of Frame

f1.setSize(500,500);

f1.setLayout(null);

f1.setVisible(true);

}

public static void main(String args[])

{

   assign a1 = new assign();

}

}


OUTPUT-




Comments