idcard
idcard
*;
import javax.swing.*;
import java.awt.event.*;
class Panel1 extends Panel implements ActionListener{
JLabel l1,l2,l3,l4,l5,l6,l7,l8;
JTextArea ta;
JTextField t1,t2;
JComboBox c1;
JRadioButton r1,r2,r3,r4;
JButton b ,b1;
Panel1()
{
setLayout(null);
Font f=new Font("Times new roman",Font.BOLD|Font.ITALIC,20);
l1=new JLabel("ID Card Generator System");
l1.setFont(f);
l1.setBounds(100,100,300,20);
l8=new JLabel("Add photo");
l8.setBounds(100,200,150,20);
l2=new JLabel("Enter Student name :");
l2.setBounds(100,250,150,20);
l3=new JLabel("Select Department");
l3.setBounds(100,300,150,20);
l4=new JLabel("Select Enrollment no.");
l4.setBounds(100,350,150,20);
l5=new JLabel("Enter Address");
l5.setBounds(100,400,150,20);
l6=new JLabel("Enter date of birth");
l6.setBounds(100,450,150,20);
l7=new JLabel("Enter mobile no");
l7.setBounds(100,500,150,20);
ta=new JTextArea(40,20);
ta.setBounds(300,400,150,50);
t1=new JTextField(50);
t1.setBounds(300,250,150,20);
t2=new JTextField(10);
t2.setBounds(300,500,150,20);
r1=new JRadioButton("CO");
r1.setBounds(300,300,50,20);
r2=new JRadioButton("CE");
r2.setBounds(350,300,50,20);
r3=new JRadioButton("ENTC");
r3.setBounds(400,300,70,20);
r4=new JRadioButton("ME");
r4.setBounds(470,300,50,20);
c1=new JComboBox();
c1.addItem("2005080001");
c1.addItem("2005080002");
c1.addItem("2005080003");
c1.addItem("2005080004");
c1.addItem("2005080005");
c1.addItem("2005080006");
c1.addItem("2005080007");
c1.addItem("2005080008");
c1.addItem("2005080009");
c1.addItem("2005080010");
c1.setBounds(300,350,150,20);
add(l1);
add(l2);
add(l3);
add(l4);
add(l5);
add(l6);
add(l7);
add(l8);
add(b);
add(b1);
add(t1);
add(t2);
add(ta);
add(c1);
add(r1);
add(r2);
add(r3);
add(r4);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==b1) {
FileDialog f= new FileDialog (this,"select
photo",FileDialog.LOAD); //error
f.setVisible(true);
}
}