forked from alexs2112/Scholarship-Thing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScholarCoordLogin.java
89 lines (79 loc) · 3.01 KB
/
ScholarCoordLogin.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
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.Font;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextPane;
import javax.swing.JEditorPane;
import javax.swing.JTextArea;
import javax.swing.JToolBar;
import java.awt.Color;
public class ScholarCoordLogin extends JFrame {
private static final long serialVersionUID = 1060623638149583738L;
/**
* Create the frame.
*/
public ScholarCoordLogin(Data data, User user) {
//deisgn elements
getContentPane().setBackground(Color.ORANGE);
setTitle("University of Calgary Scholarship Application System | Scholarship Coordinator Login");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 760, 445);
getContentPane().setLayout(null);
JLabel lblNewLabel = new JLabel("Welcome " + user.name());
lblNewLabel.setFont(new Font("Tahoma", Font.ITALIC, 18));
lblNewLabel.setBounds(22, 60, 483, 30);
getContentPane().add(lblNewLabel);
//brings user to new window where they can create a new scholarship
JButton btnNewButton = new JButton("Create New Award");
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
NewAward addAward = new NewAward(data);
addAward.setVisible(true);
}
});
btnNewButton.setBounds(267, 125, 225, 30);
getContentPane().add(btnNewButton);
//brings user to a new window where they can edit or delete existing awards
JButton btnNewButton_1 = new JButton("Edit/Delete Existing Award");
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ExistingAward editAward = new ExistingAward(data);
editAward.setVisible(true);
}
});
btnNewButton_1.setBounds(267, 167, 225, 30);
getContentPane().add(btnNewButton_1);
//logs user out of the system and returns to login page
JButton btnNewButton_2 = new JButton("Logout");
btnNewButton_2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
dispose();
Login window = new Login(data);
window.frmLogin().setVisible(true);
}
});
btnNewButton_2.setBounds(327, 261, 117, 30);
getContentPane().add(btnNewButton_2);
//deisgn elements
JLabel lblNewLabel_1 = new JLabel("University of Calgary Scholarship Application System");
lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 18));
lblNewLabel_1.setBounds(142, 6, 493, 36);
getContentPane().add(lblNewLabel_1);
//brings user to new window where they can award scholarships to students
JButton btnNewButton_3 = new JButton("Award Scholarships");
btnNewButton_3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
GiveAward giveAw = new GiveAward(data);
giveAw.setVisible(true);
}
});
btnNewButton_3.setBounds(267, 210, 225, 29);
getContentPane().add(btnNewButton_3);
}
}