-
Notifications
You must be signed in to change notification settings - Fork 0
/
Payment.java
47 lines (38 loc) · 1000 Bytes
/
Payment.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
package managementSystem;
import javax.swing.*;
import java.awt.*;
import java.sql.*;
import java.awt.event.*;
public class Payment extends JFrame implements ActionListener{
JButton pay,back;
Payment(){
setBounds(365,160,800,600);
setLayout(null);
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/paytm.jpeg"));
Image i2= i1.getImage().getScaledInstance(800, 600, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(0,0,800,600);
add(image);
pay=new JButton("Pay");
pay.setBounds(420,0,80,40);
pay.addActionListener(this);
image.add(pay);
back=new JButton("Back");
back.setBounds(520,0,80,40);
back.addActionListener(this);
image.add(back);
setVisible(true);
}
public void actionPerformed(ActionEvent ae) {
if(ae.getSource()==pay) {
setVisible(false);
new Paytm();
}else {
setVisible(false);
}
}
public static void main(String[] args) {
new Payment();
}
}