-
Notifications
You must be signed in to change notification settings - Fork 2
/
StudLin.java
90 lines (82 loc) · 2.48 KB
/
StudLin.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
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing. JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
public class StudLin extends JFrame{
StudLin(){
JPanel p0=new JPanel();
JPanel p1=new JPanel(new GridLayout(6,1,10,5));
JLabel n1=new JLabel();
JButton m2=new JButton("Home");
m2.setForeground(Color.BLUE.darker());
m2.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
m2.setHorizontalAlignment(JLabel.CENTER);
m2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (e.getSource()==m2) {
Home ad =new Home();
ad.setSize(600,400);
ad.setLocationRelativeTo(null);
ad.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ad.setVisible(true);
ad.setResizable(false);
dispose();
}
}
});
JButton m3=new JButton("View Attendance");
m3.setForeground(Color.BLUE.darker());
m3.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
m3.setHorizontalAlignment(JLabel.CENTER);
m3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(e.getSource()==m3) {
VAttend1 ad=new VAttend1();
ad.setSize(600,400);
ad.setLocationRelativeTo(null);
ad.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ad.setVisible(true);
ad.setResizable(false);
dispose();
}
}
});
JButton m4=new JButton("Average");
m4.setForeground(Color.BLUE.darker());
m4.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
m4.setHorizontalAlignment(JLabel.CENTER);
JButton m5=new JButton("Logout");
m5.setForeground(Color.BLUE.darker());
m5.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
m5.setHorizontalAlignment(JLabel.CENTER);
m5.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
if(e.getSource()==m5) {
JOptionPane.showMessageDialog(null,"You have successfully been logged out !");
Home ad=new Home();
ad.setSize(600,400);
ad.setLocationRelativeTo(null);
ad.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ad.setVisible(true);
ad.setResizable(false);
dispose();
}
}
});
p1.add(n1);
p1.add(m2);
p1.add(m3);
p1.add(m4);
p1.add(m5);
setLayout(new GridLayout(1,2));
add(p0);
add(p1);
}
}