/*FIRST PROGRAME WITH MAIN CLASS*/
import java.awt.*;
import java.awt.event.*;
class first extends Frame implements ActionListener
{
Button b;
Toolkit t;
Image i,i1,i2;
Label a,a1,a2;
public first()
{
Color col=new Color(100,200,200);
setBackground(col);
a=new Label("ADDRESS BOOK");
a1=new Label("(DEVELOPED BY)");
a2=new Label("JAGJEET SINGH RAJINDER PAL SINGH TEJINDER SINGH");
b=new Button("CLICK TO PROCEED");
t=Toolkit.getDefaultToolkit();
i=t.getImage("f:/jaggi/1.jpg");
i1=t.getImage("f:/jaggi/2.jpg");
i2=t.getImage("f:/jaggi/3.jpg");
add(a);
add(a1);
add(a2);
add(b);
b.addActionListener(this);
}
public void actionPerformed(ActionEvent e)
{
loginb b=new loginb();
}
public void paint(Graphics g)
{
a.setBounds(280,40,400,50);
a1.setBounds(280,80,700,70);
a2.setBounds(60,150,990,50);
b.setBounds(230,530,350,50);
Font f=new Font("Arial",Font.ITALIC,30);
a.setFont(f);
a1.setFont(f);
Font h=new Font("Arial",Font.ITALIC,20);
a2.setFont(h);
g.drawImage(i,10,200,this);
g.drawImage(i1,290,200,this);
g.drawImage(i2,560,200,this);
}
}
class f
{
public static void main(String ap[])
{
first d=new first();
d.setSize(800,600);
d.setVisible(true);
}
}
Sunday, September 23, 2007
MAIN CLASS