-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThankYou.java
More file actions
39 lines (32 loc) · 1.38 KB
/
ThankYou.java
File metadata and controls
39 lines (32 loc) · 1.38 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
package project;
import javax.swing.*;
import java.awt.*;
class ThankYou extends JFrame {
JFrame frame ;
ThankYou(){
frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Get the size of the screen
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
// Set the size of the frame to the size of the screen
frame.setSize(screenSize);
frame.setExtendedState(JFrame.MAXIMIZED_BOTH); // Maximize the frame
// Create a panel with custom styling
JPanel panel = new JPanel() {
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2d = (Graphics2D) g.create();
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
g2d.setColor(new Color(135, 206, 250)); // Setting background color
g2d.fillRect(0, 0, getWidth(), getHeight());
g2d.dispose();
}
};
panel.setLayout(new GridBagLayout());
JLabel label = new JLabel("<html><div style='text-align: center; color: #191970; font-size: 45pt; font-family: Times New Roman;'><b>Thank You For Visiting Our Platform !</b></div></html>");
panel.add(label);
frame.add(panel);
frame.setVisible(true);
}
}