-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUserLoged.java
137 lines (107 loc) · 4.67 KB
/
UserLoged.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
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
package UserClasses;
import AdminClasses.HomeLibrary;
import BookClasses.*;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class UserLoged extends JFrame {
static UserLoged frame;
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
frame = new UserLoged();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
public UserLoged()
{
setLayout(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(200, 80, 880, 550);
ImageIcon icon = new ImageIcon(ClassLoader.getSystemResource("img/lib2.jpg"));
Image scaleIcon = icon.getImage().getScaledInstance(800,800,Image.SCALE_DEFAULT);
setIconImage(scaleIcon);
ImageIcon bgImg = new ImageIcon(ClassLoader.getSystemResource("img/VeryBlue.jpg"));
Image scalebgImg = bgImg.getImage().getScaledInstance(880,550,Image.SCALE_DEFAULT);
ImageIcon newbgImg = new ImageIcon(scalebgImg);
JLabel background = new JLabel();
background.setBounds(0,0,880,550);
background.setIcon(newbgImg);
background.setOpaque(true);
add(background);
ImageIcon Img12 = new ImageIcon(ClassLoader.getSystemResource("img/Img12.png"));
Image scaleImg12 = Img12.getImage().getScaledInstance(405,455,Image.SCALE_DEFAULT);
ImageIcon newImg12 = new ImageIcon(scaleImg12);
JLabel lblImg12 = new JLabel();
lblImg12.setBounds(45,28,410,455);
lblImg12.setBorder(BorderFactory.createLineBorder(Color.WHITE, 10));
lblImg12.setIcon(newImg12);
background.add(lblImg12);
JLabel lblUserSection = new JLabel("User Section");
lblUserSection.setBounds(540,0,200, 80);
lblUserSection.setFont(new Font("Tahoma", Font.BOLD, 30));
lblUserSection.setForeground(Color.ORANGE);
background.add(lblUserSection);
JButton btnViewBooks = new JButton("View Books");
btnViewBooks.setBounds(540,100,200,50);
btnViewBooks.setBackground(Color.white);
background.add(btnViewBooks);
btnViewBooks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
ViewBooks.main(new String[]{});
frame.dispose();
}
});
btnViewBooks.setFont(new Font("Tahoma", Font.PLAIN, 13));
JButton btnIssueBook = new JButton("Issue Book");
btnIssueBook.setBounds(540,184,200,50);
btnIssueBook.setBackground(Color.orange);
background.add(btnIssueBook);
btnIssueBook.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
IssueBookForm.main(new String[]{});
frame.dispose();
}
});
btnIssueBook.setFont(new Font("Tahoma", Font.PLAIN, 13));
JButton btnViewIssuedBooks = new JButton("Book Categories");
btnViewIssuedBooks.setBounds(540,265,200,50);
btnViewIssuedBooks.setBackground(Color.green);
background.add(btnViewIssuedBooks);
btnViewIssuedBooks.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
BooksCategories.main(new String[]{});
frame.dispose();
}
});
btnViewIssuedBooks.setFont(new Font("Tahoma", Font.PLAIN, 13));
JButton btnReturnBook = new JButton("Return Book");
btnReturnBook.setBounds(540,350,200,50);
btnReturnBook.setBackground(Color.pink);
background.add(btnReturnBook);
btnReturnBook.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ReturnBook.main(new String[]{});
frame.dispose();
}
});
btnReturnBook.setFont(new Font("Tahoma", Font.PLAIN, 13));
JButton btnLogout = new JButton("Logout");
btnLogout.setBounds(540,430,200,40);
btnLogout.setBackground(Color.red);
background.add(btnLogout);
btnLogout.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
HomeLibrary.main(new String[]{});
frame.dispose();
}
});
btnLogout.setFont(new Font("Tahoma", Font.PLAIN, 15));
}
}