-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathregistrarHome.java
More file actions
131 lines (116 loc) · 4.01 KB
/
registrarHome.java
File metadata and controls
131 lines (116 loc) · 4.01 KB
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
package regPrototype;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.Color;
import javax.swing.JLabel;
import javax.swing.JButton;
import javax.swing.AbstractAction;
import java.awt.event.ActionEvent;
import javax.swing.Action;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ActionListener;
public class registrarHome extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
registrarHome frame = new registrarHome();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public registrarHome() {
setTitle("Registrar Home Page");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 450, 300);
contentPane = new JPanel();
contentPane.setBackground(new Color(0, 102, 153));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JLabel lblRegistrarPicture = new JLabel("Registrar Picture");
lblRegistrarPicture.setBounds(10, 10, 177, 120);
contentPane.add(lblRegistrarPicture);
JLabel lblRegistrarName = new JLabel("Registrar Name");
lblRegistrarName.setForeground(new Color(255, 255, 255));
lblRegistrarName.setBounds(10, 140, 131, 14);
contentPane.add(lblRegistrarName);
JLabel lblDepartment = new JLabel("Department");
lblDepartment.setForeground(new Color(255, 255, 255));
lblDepartment.setBounds(10, 160, 131, 14);
contentPane.add(lblDepartment);
JButton btnRegisterStudent = new JButton("RegisterStudent");
btnRegisterStudent.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent arg0) {
//Opens a new Register Student window, which displays a form that must be filled in order to add a new student
dispose();
new RegisterStudent().setVisible(true);
}
});
btnRegisterStudent.setBounds(274, 30, 122, 23);
contentPane.add(btnRegisterStudent);
JButton btnViewStudent = new JButton("View Students");
btnViewStudent.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent arg1) {
//Opens a new View Student window, which displays all of the students in the database
dispose();
new ViewStudents().setVisible(true);
}
});
btnViewStudent.setBounds(274, 72, 122, 23);
contentPane.add(btnViewStudent);
JButton btnLookUpClasses = new JButton("Add classes");
btnLookUpClasses.addMouseListener(new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
//Opens a new addClassesRegistrar window, which contains a form in order to add a new course
dispose();
new addClassesRegistrar().setVisible(true);
}
});
btnLookUpClasses.setBounds(274, 106, 122, 23);
contentPane.add(btnLookUpClasses);
JButton btnNewButton = new JButton("View all classes");
btnNewButton.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
//Opens a new viewAllCoursesRegistrar window, which contains all of the courses
dispose();
new ViewAllCoursesRegistrar().setVisible(true);
}
});
btnNewButton.setBounds(274, 140, 122, 23);
contentPane.add(btnNewButton);
JButton btnLogOut = new JButton("Log Out");
btnLogOut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
new homePage().setVisible(true);
}
});
btnLogOut.setBounds(335, 227, 89, 23);
contentPane.add(btnLogOut);
}
private class SwingAction extends AbstractAction {
public SwingAction() {
putValue(NAME, "SwingAction");
putValue(SHORT_DESCRIPTION, "Some short description");
}
public void actionPerformed(ActionEvent e) {
}
}
}