-
Notifications
You must be signed in to change notification settings - Fork 0
/
PaySuccess.java
104 lines (86 loc) · 3.05 KB
/
PaySuccess.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
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
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public class PaySuccess extends JFrame {
private Container c;
private ImageIcon icon;
private JLabel label1, imgLabel;
private Font f1, f2;
private ImageIcon logo;
private JButton btn1,btn2, nBtn;
private Cursor cursor;
PaySuccess() {
// Frame Layout
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setTitle("Travel Agency");
this.setSize(900, 450);
this.setLocationRelativeTo(null);
this.setResizable(false);
c = this.getContentPane();
c.setLayout(null);
c.setBackground(Color.decode("#F2F2F2"));
// Icon
icon = new ImageIcon(getClass().getResource("/images/icon.png"));
this.setIconImage(icon.getImage());
// Logo
logo = new ImageIcon(getClass().getResource("/images/logo.jpg"));
imgLabel = new JLabel(logo);
imgLabel.setBounds(30, 30, logo.getIconWidth(), logo.getIconHeight());
c.add(imgLabel);
// Fonts
f1 = new Font("Segoe UI Black", Font.PLAIN, 35);
f2 = new Font("Segoe UI Black", Font.PLAIN, 25);
// Title
label1 = new JLabel();
label1.setText("Your Payment Has");
label1.setBounds(430, 80, 500, 50);
label1.setFont(f1);
c.add(label1);
label1 = new JLabel();
label1.setText("Successfully Completed.");
label1.setBounds(430, 130, 500, 50);
label1.setFont(f1);
c.add(label1);
label1 = new JLabel();
label1.setText("Thank you for your Patience");
label1.setBounds(430, 180, 600, 50);
label1.setFont(f2);
c.add(label1);
// Cursor for JButtons
cursor = new Cursor(Cursor.HAND_CURSOR);
btn1 = new JButton("Done");
btn1.setBounds(300, 340, 200, 50);
btn1.setFont(f2);
btn1.setCursor(cursor);
btn1.setForeground(Color.WHITE);
btn1.setBackground(Color.decode("#2E75B6"));
c.add(btn1);
btn2 = new JButton("Back");
btn2.setBounds(575, 340, 200, 50);
btn2.setFont(f2);
btn2.setCursor(cursor);
btn2.setForeground(Color.WHITE);
btn2.setBackground(Color.decode("#2E75B6"));
c.add(btn2);
nBtn = new JButton("");
nBtn.setBounds(0, 0, 0, 0);
c.add(nBtn);
btn1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
System.exit(0);
}
});
// Back Button
btn2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
setVisible(false);
Options frame = new Options();
frame.setVisible(true);
}
});
}
public static void main(String[] args) {
PaySuccess frame = new PaySuccess();
frame.setVisible(true);
}
}