-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain_class.java
More file actions
70 lines (61 loc) · 2.17 KB
/
Main_class.java
File metadata and controls
70 lines (61 loc) · 2.17 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
package employee.management.stystem;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Main_class extends JFrame {
Main_class(){
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/home.jpg"));
Image i2 = i1.getImage().getScaledInstance(1120,630,Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel img = new JLabel(i3);
img.setBounds(0,0,1120,630);
add(img);
JLabel heading = new JLabel("Employee Management System");
heading.setBounds(340,155,400,40);
heading.setFont(new Font("Raleway",Font.BOLD,25));
img.add(heading);
JButton add = new JButton("Add Employee");
add.setBounds(335,270,150,40);
add.setForeground(Color.WHITE);
add.setBackground(Color.black);
add.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new AddEmployee();
setVisible(false);
}
});
img.add(add);
JButton view = new JButton("View Employee");
view.setBounds(565,270,150,40);
view.setForeground(Color.WHITE);
view.setBackground(Color.black);
view.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new View_Employee();
setVisible(false);
}
});
img.add(view);
JButton rem = new JButton("Remove Employee");
rem.setBounds(440,370,150,40);
rem.setForeground(Color.WHITE);
rem.setBackground(Color.black);
rem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
new RemoveEmployee();
}
});
img.add(rem);
setSize(1120,630);
setLocation(250,100);
setLayout(null);
setVisible(true);
}
public static void main(String[] args) {
new Main_class();
}
}