Hi Friend's
Program to make a simple application form in java.
import java.awt.*;
import java.applet.*;
public class application extends Applet
{
Label lb;
Font f1,f2;
TextField t1,t2,t3,t4,t5;
Button b1,b2;
public void init()
{
setLayout(null);
lb=new Label(“*Customer Information”);
lb.setBounds(20,80,150,20);
Color c11=new Color(253,231,249);
setBackground(c11);
f1=new Font(“Arial”,Font.BOLD,40);
f2=new Font(“Arial”,Font.BOLD,20);
t1=new TextField(20);
t2=new TextField(20);
t3=new TextField(20);
t4=new TextField(20);
t5=new TextField(20);
t1.setBounds(170,115,170,25);
t2.setBounds(170,145,170,25);
t3.setBounds(170,170,170,25);
t4.setBounds(170,195,170,25);
t5.setBounds(170,220,170,25);
b1=new Button(“Submit”);
b1.setBounds(170,270,50,20);
b2=new Button(“Reset”);
b2.setBounds(290,270,50,20);
add(lb);
add(t1);
add(t2);
add(t3);
add(t4);
add(t5);
add(b1);
add(b2);
}
public void paint(Graphics m)
{
m.drawLine(329,40,27,40);
m.setFont(f1);
m.drawString(“Application form”,20,30);
m.setFont(f2);
m.drawString(“User Name:”,20,135);
m.setFont(f2);
m.drawString(“Father Name:”,20,160);
m.setFont(f2);
m.drawString(“Mother Name:”,20,185);
m.setFont(f2);
m.drawString(“Address:”,20,210);
m.setFont(f2);
m.drawString(“Contect No:”,20,235);
}
}
//<applet code=application width=400 height=300></applet>
import java.applet.*;
public class application extends Applet
{
Label lb;
Font f1,f2;
TextField t1,t2,t3,t4,t5;
Button b1,b2;
public void init()
{
setLayout(null);
lb=new Label(“*Customer Information”);
lb.setBounds(20,80,150,20);
Color c11=new Color(253,231,249);
setBackground(c11);
f1=new Font(“Arial”,Font.BOLD,40);
f2=new Font(“Arial”,Font.BOLD,20);
t1=new TextField(20);
t2=new TextField(20);
t3=new TextField(20);
t4=new TextField(20);
t5=new TextField(20);
t1.setBounds(170,115,170,25);
t2.setBounds(170,145,170,25);
t3.setBounds(170,170,170,25);
t4.setBounds(170,195,170,25);
t5.setBounds(170,220,170,25);
b1=new Button(“Submit”);
b1.setBounds(170,270,50,20);
b2=new Button(“Reset”);
b2.setBounds(290,270,50,20);
add(lb);
add(t1);
add(t2);
add(t3);
add(t4);
add(t5);
add(b1);
add(b2);
}
public void paint(Graphics m)
{
m.drawLine(329,40,27,40);
m.setFont(f1);
m.drawString(“Application form”,20,30);
m.setFont(f2);
m.drawString(“User Name:”,20,135);
m.setFont(f2);
m.drawString(“Father Name:”,20,160);
m.setFont(f2);
m.drawString(“Mother Name:”,20,185);
m.setFont(f2);
m.drawString(“Address:”,20,210);
m.setFont(f2);
m.drawString(“Contect No:”,20,235);
}
}
//<applet code=application width=400 height=300></applet>
………………………………………………………………………………………
first open command prompt on your computer after then set path …
………………………………………………………………………………….
1- for compile - javac application.java
0 Comments