-
Notifications
You must be signed in to change notification settings - Fork 0
/
Show_Data.java
177 lines (139 loc) · 5.13 KB
/
Show_Data.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.sql.*;
class Show_Data implements ActionListener{
JFrame f;
JLabel id8,id,aid,id1,aid1,id2,aid2,id3,aid3,id4,aid4,id5,aid5,id6,aid6,id7,aid7,id9,id10,id11,id12,id13,id14,id15,id16,id17,lab;
String emp_id,name,father,address,phone,email,education,post,age,dob,aadhar;
JButton b1,b2;
ImageIcon icon;
Show_Data(String e_id){
try{
conn con = new conn();
String str = "select * from employee where emp_id = '"+e_id+"'";
ResultSet rs= con.s.executeQuery(str);
while(rs.next()){
name = rs.getString("name");
father = rs.getString("fname");
age = rs.getString("age");
dob = rs.getString("dob");
address = rs.getString("address");
phone = rs.getString("phone");
email = rs.getString("email");
education = rs.getString("education");
post = rs.getString("post");
emp_id = rs.getString("emp_id");
}
}catch(Exception e){
e.printStackTrace();
}
f=new JFrame("Print Data");
f.setVisible(true);
f.setSize(595,642);
f.setLocation(450,200);
f.setBackground(Color.white);
f.setLayout(null);
id9=new JLabel();
id9.setBounds(0,0,595,642);
id9.setLayout(null);
ImageIcon img=new ImageIcon(ClassLoader.getSystemResource("Icons/print.jpg"));
id9.setIcon(img);
id8 = new JLabel("Employee Details:");
id8.setBounds(50,10,250,30);
f.add(id8);
id8.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id8);
f.add(id9);
id = new JLabel("Employee Id:");
id.setBounds(50,70,120,30);
id.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id);
aid = new JLabel(emp_id);
aid.setBounds(200,70,200,30);
aid.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid);
id1 = new JLabel("Name:");
id1.setBounds(50,120,100,30);
id1.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id1);
aid1 = new JLabel(name);
aid1.setBounds(200,120,300,30);
aid1.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid1);
id2 = new JLabel("Father's Name:");
id2.setBounds(50,170,200,30);
id2.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id2);
aid2 = new JLabel(father);
aid2.setBounds(200,170,300,30);
aid2.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid2);
id3= new JLabel("Address:");
id3.setBounds(50,220,100,30);
id3.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id3);
aid3= new JLabel(address);
aid3.setBounds(200,220,300,30);
aid3.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid3);
id4= new JLabel("Phone No:");
id4.setBounds(50,270,100,30);
id4.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id4);
aid4= new JLabel(phone);
aid4.setBounds(200,270,300,30);
aid4.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid4);
id5= new JLabel("Email Id:");
id5.setBounds(50,320,100,30);
id5.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id5);
aid5= new JLabel(email);
aid5.setBounds(200,320,300,30);
aid5.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid5);
id6= new JLabel("Education:");
id6.setBounds(50,370,100,30);
id6.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id6);
aid6= new JLabel(education);
aid6.setBounds(200,370,300,30);
aid6.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid6);
id7= new JLabel("Job Post:");
id7.setBounds(50,420,100,30);
id7.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(id7);
aid7= new JLabel(post);
aid7.setBounds(200,420,300,30);
aid7.setFont(new Font("Comic Sans MS",Font.BOLD,18));
id9.add(aid7);
b1=new JButton("OK");
b1.setBackground(Color.BLACK);
b1.setForeground(Color.WHITE);
b1.setBounds(100,520,100,30);
b1.addActionListener(this);
id9.add(b1);
b2=new JButton("Cancel");
b2.setBackground(Color.BLACK);
b2.setForeground(Color.WHITE);
b2.setBounds(250,520,100,30);
b2.addActionListener(this);
id9.add(b2);
}
public void actionPerformed(ActionEvent ae){
if(ae.getSource()==b1){
JOptionPane.showMessageDialog(null,"successful");
f.setVisible(false);
details d=new details();
}
if(ae.getSource()==b2){
f.setVisible(false);
new View_Employee();
}
}
public static void main(String[] args){
new Show_Data("Print Data");
}
}