-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReception.java
More file actions
156 lines (133 loc) · 5.48 KB
/
Copy pathReception.java
File metadata and controls
156 lines (133 loc) · 5.48 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
package hotel.management.system;
import javax.swing.*; // For GUI components
import java.awt.*; // For layout and color customization
import java.awt.event.*; // For handling button actions
import java.sql.*; // For database connectivity
public class Reception extends JFrame {
private JPanel contentPane; // Panel to hold all UI components
/*
Main method to run the Reception screen.
*/
public static void main(String[] args) {
new Reception(); // Create an instance of the Reception class
}
/*
Constructor to initialize and set up the Reception screen.
*/
public Reception() {
// Frame settings
setBounds(380, 150, 850, 570); // Set size and position of the frame
contentPane = new JPanel(); // Initialize the panel
setContentPane(contentPane); // Set the panel as the content pane
contentPane.setLayout(null); // Use absolute positioning for components
// Add an image to the frame
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/concierge.gif")); // Load concierge image
Image i3 = i1.getImage().getScaledInstance(500, 500, Image.SCALE_DEFAULT); // Resize image
ImageIcon i2 = new ImageIcon(i3); // Create an ImageIcon from resized image
JLabel l1 = new JLabel(i2); // Create a JLabel to hold the image
l1.setBounds(250, 30, 500, 470); // Position and size of the image
add(l1); // Add the image to the frame
// Add buttons for different functionalities
// Each button navigates to a specific functionality
createButton("New Customer Form", 10, 30, e -> {
try {
new NewCustomer().setVisible(true); // Open New Customer Form
setVisible(false); // Hide current frame
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Room", 10, 70, e -> {
try {
new Room().setVisible(true); // Open Room information
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Department", 10, 110, e -> {
try {
new Department().setVisible(true); // Open Department information
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Employee Info", 10, 150, e -> {
try {
new Employee().setVisible(true); // Open Employee information
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Customer Info", 10, 190, e -> {
try {
new CustomerInfo().setVisible(true); // Open Customer Info
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Manager Info", 10, 230, e -> {
try {
new ManagerInfo().setVisible(true); // Open Manager Info
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Check out", 10, 270, e -> {
try {
new Checkout().setVisible(true); // Open Checkout functionality
setVisible(false);
} catch (SQLException e1) {
e1.printStackTrace();
}
});
createButton("Update Check Status", 10, 310, e -> {
try {
new UpdateCheck().setVisible(true); // Open Update Check Status
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Pick up Service", 10, 350, e -> {
try {
new PickUp().setVisible(true); // Open Pick-up Service
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Search Room", 10, 390, e -> {
try {
new SearchRoom().setVisible(true); // Open Search Room functionality
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
createButton("Log Out", 10, 430, e -> {
try {
new Login().setVisible(true); // Log out and go to Login screen
setVisible(false);
} catch (Exception e1) {
e1.printStackTrace();
}
});
// Set frame background color
getContentPane().setBackground(Color.WHITE);
// Make the frame visible
setVisible(true);
}
private void createButton(String text, int x, int y, ActionListener listener) {
JButton button = new JButton(text); // Create a new button
button.setBounds(x, y, 200, 30); // Set button position and size
button.setBackground(Color.BLACK); // Set button background color
button.setForeground(Color.WHITE); // Set button text color
button.addActionListener(listener); // Add the ActionListener
contentPane.add(button); // Add the button to the content pane
}
}