-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.java
More file actions
67 lines (55 loc) · 2.06 KB
/
Home.java
File metadata and controls
67 lines (55 loc) · 2.06 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
package employee.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Home extends JFrame implements ActionListener{
JButton add, view, update, remove;
public Home(){
setLayout(null);
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 image = new JLabel(i3);
image.setBounds(0,0, 1120,630);
add(image);
JLabel heading = new JLabel("Employee Management System");
heading.setBounds(620, 20, 400, 40);
heading.setFont(new Font("serif", Font.BOLD, 25));
image.add(heading);
add=new JButton("Add Employee");
add.setBounds(650,80,150,40);
image.add(add);
view=new JButton("View Employee");
view.setBounds(820,80,150,40);
image.add(view);
update = new JButton("Update Employee");
update.setBounds(650, 140, 150, 40);
update.addActionListener(this);
image.add(update);
remove = new JButton("Remove Employee");
remove.setBounds(820, 140, 150, 40);
remove.addActionListener(this);
image.add(remove);
setSize(1200,600);
setLocation(200,100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setBackground(Color.GRAY);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == add) {
setVisible(false);
new AddEmployee();
} else if (ae.getSource() == view) {
setVisible(false);
new ViewEmployee();
} else if (ae.getSource() == update) {
} else {
}
}
public static void main(String[] args){
new Home();
}
}