-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAdmin.java
61 lines (52 loc) · 1.91 KB
/
Admin.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
package hospital_management;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Admin extends JFrame{
private JPanel pan1 = new JPanel();
private JPanel pan = new JPanel();
private JButton logOut = new JButton("logOut");
private JButton createUser = new JButton("Create user");
private JButton doctor = new JButton("Doctor");
Admin(){
JLabel labLL = new JLabel("WELCOME TO\n HOSPITAL MANAGEMENT SYSTEM ");
setLayout(new BorderLayout());
pan1.add(labLL);
// Create a JLabel for the image
JLabel imageLabel = new JLabel();
// Load the image from a file
ImageIcon imageIcon = new ImageIcon("C://Users/Hirut Tarekegn/Desktop/javaproject1/images (4).jfif");
// Set the image icon to the JLabel
imageLabel.setIcon(imageIcon);
pan1.add(imageLabel);
pan.setLayout(new FlowLayout(FlowLayout.LEFT));
createUser.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new CreateUser();
setVisible(false);
}
});
doctor.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
DoctorForm doctorForm = new DoctorForm();
doctorForm.setVisible(true);
setVisible(false);
}
});
logOut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Hospital_Management hm= new Hospital_Management();
setVisible(false);
}
});
pan.add(createUser);
pan.add(doctor);
pan.add(logOut);
add(pan1,BorderLayout.CENTER);
add(pan,BorderLayout.SOUTH);
setSize(400, 350);
setVisible(true);
setLocationRelativeTo(null);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}