-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrarianSuccess.java
More file actions
156 lines (137 loc) · 5.91 KB
/
LibrarianSuccess.java
File metadata and controls
156 lines (137 loc) · 5.91 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
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
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.GroupLayout;
import javax.swing.GroupLayout.Alignment;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.SwingConstants;
public class LibrarianSuccess {
private JFrame frame;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LibrarianSuccess window = new LibrarianSuccess();
window.frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public LibrarianSuccess() {
initialize();
}
private void initialize() {
frame = new JFrame();
frame.setBounds(100, 100, 640, 460);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JLabel lblNewLabel = new JLabel("LIBRARIAN SECTION");
lblNewLabel.setForeground(Color.GRAY);
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 28));
JButton btnAddLibrarian = new JButton("Add Student");
btnAddLibrarian.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
StudentForm.main(new String[]{});
frame.dispose();
}
});
btnAddLibrarian.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton btnDeleteLibrarian = new JButton("Delete Student");
btnDeleteLibrarian.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DeleteStudent.main(new String[]{});
frame.dispose();
}
});
btnDeleteLibrarian.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton button = new JButton("Add New Book");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BooksForm.main(new String[]{});
frame.dispose();
}
});
button.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton btnViewBooks = new JButton("View Books");
btnViewBooks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ViewBooks.main(new String[]{});
}
});
btnViewBooks.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton btnViewIssuedBooks = new JButton("View Issued Books");
btnViewIssuedBooks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ViewIssuedBooks.main(new String[]{});
}
});
btnViewIssuedBooks.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton btnLogOut = new JButton("Log Out");
btnLogOut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Library.main(new String[]{});
frame.dispose();
}
});
btnLogOut.setFont(new Font("Tahoma", Font.PLAIN, 18));
JButton btnFineImposed = new JButton("Fine Imposed");
btnFineImposed.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Fine.main(new String[]{});
frame.dispose();
}
});
btnFineImposed.setFont(new Font("Tahoma", Font.PLAIN, 18));
GroupLayout groupLayout = new GroupLayout(frame.getContentPane());
groupLayout.setHorizontalGroup(
groupLayout.createParallelGroup(Alignment.TRAILING)
.addGroup(groupLayout.createSequentialGroup()
.addGap(182)
.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
.addComponent(lblNewLabel, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(groupLayout.createSequentialGroup()
.addPreferredGap(ComponentPlacement.RELATED, 21, Short.MAX_VALUE)
.addGroup(groupLayout.createParallelGroup(Alignment.TRAILING, false)
.addComponent(btnAddLibrarian, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnDeleteLibrarian, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(button, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnViewBooks, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnViewIssuedBooks, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, 220, Short.MAX_VALUE)
.addComponent(btnFineImposed, Alignment.LEADING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(20)))
.addContainerGap(179, Short.MAX_VALUE))
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap(268, Short.MAX_VALUE)
.addComponent(btnLogOut)
.addGap(257))
);
groupLayout.setVerticalGroup(
groupLayout.createParallelGroup(Alignment.TRAILING)
.addGroup(groupLayout.createSequentialGroup()
.addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(lblNewLabel)
.addGap(34)
.addComponent(btnAddLibrarian, GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
.addGap(18)
.addComponent(btnDeleteLibrarian, GroupLayout.DEFAULT_SIZE, 238, Short.MAX_VALUE)
.addGap(18)
.addComponent(button, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnViewBooks, GroupLayout.PREFERRED_SIZE, 43, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnViewIssuedBooks, GroupLayout.PREFERRED_SIZE, 40, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(btnFineImposed, GroupLayout.PREFERRED_SIZE, 39, GroupLayout.PREFERRED_SIZE)
.addGap(37)
.addComponent(btnLogOut)
.addGap(67))
);
frame.getContentPane().setLayout(groupLayout);
}
}