-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTransaction.java
99 lines (80 loc) · 3.32 KB
/
Transaction.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
package bank.management.system;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class Transaction extends JFrame implements ActionListener{
JButton deposit,withdrawl,ministatement,fastcash,pinchange,balanceenquiry,exit;
String pinnumber;
Transaction(String pinnumber){
this.pinnumber=pinnumber;
ImageIcon i1=new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg"));
Image i2=i1.getImage().getScaledInstance(900,900,Image.SCALE_DEFAULT);
ImageIcon i3=new ImageIcon(i2);
JLabel image=new JLabel(i3);
image.setBounds(0,0,900,900);
add(image);
JLabel text=new JLabel("Please select your Transaction");
text.setBounds(210,300,700,35);
text.setForeground(Color.WHITE);
text.setFont(new Font("System",Font.BOLD,16));
image.add(text);
deposit =new JButton("Deposit");
deposit.setBounds(170,415,150,30);
deposit.addActionListener(this);
image.add(deposit);
withdrawl =new JButton("Cash Withdrawl");
withdrawl.setBounds(355,415,150,30);
withdrawl.addActionListener(this);
image.add(withdrawl);
fastcash =new JButton("Fast Cash");
fastcash.setBounds(170,450,150,30);
fastcash.addActionListener(this);
image.add(fastcash);
ministatement =new JButton("Mini Statement");
ministatement.setBounds(355,450,150,30);
ministatement.addActionListener(this);
image.add(ministatement);
pinchange =new JButton("Change PIN");
pinchange.setBounds(170,485,150,30);
pinchange.addActionListener(this);
image.add(pinchange);
balanceenquiry =new JButton("Balance Enquiry");
balanceenquiry.setBounds(355,485,150,30);
balanceenquiry.addActionListener(this);
image.add(balanceenquiry);
exit =new JButton("Exit");
exit.setBounds(355,520,150,30);
exit.addActionListener(this);
image.add(exit);
setSize(900,900);
setLocation(300,0);
setUndecorated(true);
setVisible(true);
}
public void actionPerformed(ActionEvent ae){
if(ae.getSource()==exit){
System.exit(0);
}else if(ae.getSource()==deposit){
setVisible(false);
new Deposit(pinnumber).setVisible(true);
}else if(ae.getSource()==withdrawl){
setVisible(false);
new Withdrawl(pinnumber).setVisible(true);
}else if(ae.getSource()==fastcash){
setVisible(false);
new FastCash(pinnumber).setVisible(true);
}else if(ae.getSource()==pinchange){
setVisible(false);
new PinChange(pinnumber).setVisible(true);
}else if(ae.getSource()==balanceenquiry){
setVisible(false);
new BalanceEnquiry(pinnumber).setVisible(true);
}else if(ae.getSource()==ministatement){
setVisible(false);
new MiniStatement(pinnumber).setVisible(true);
}
}
public static void main(String args[]){
new Transaction("");
}
}