-
Notifications
You must be signed in to change notification settings - Fork 0
/
TeacherAttendanceDetail.java
60 lines (49 loc) · 1.57 KB
/
TeacherAttendanceDetail.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package university.management.system;
import java.sql.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class TeacherAttendanceDetail extends JFrame implements ActionListener{
JTable j1;
JButton b1;
String h[]={"Employee id","Date Time","First Half","Second Half"};
String d[][]=new String[15][4];
int i=0,j=0;
TeacherAttendanceDetail(){
super("View Teachers Attendance");
setSize(800,300);
setLocation(450,150);
try{
String q="select * from attendance_teacher";
conn c1=new conn();
ResultSet rs=c1.s.executeQuery(q);
while(rs.next()){
d[i][j++]=rs.getString("emp_id");
d[i][j++]=rs.getString("Date");
d[i][j++]=rs.getString("first");
d[i][j++]=rs.getString("second");
i++;
j=0;
}
j1=new JTable(d,h);
}catch(Exception e){}
b1=new JButton("Print");
add(b1,"South");
JScrollPane s1=new JScrollPane(j1);
add(s1);
b1.addActionListener(this);
}
public void actionPerformed(ActionEvent ae){
try{
j1.print();
}catch(Exception e){}
}
public static void main(String[] args){
new TeacherAttendanceDetail().setVisible(true);
}
}