-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTransactions.java
More file actions
115 lines (101 loc) · 4.07 KB
/
Copy pathTransactions.java
File metadata and controls
115 lines (101 loc) · 4.07 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
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class Transactions extends JFrame implements ActionListener {
JButton depositBtn, cashWithdrawBtn, exitBtn, fastCashBtn, miniStatementBtn, balanceEnquiryBtn, pinChangeBtn;
Transactions() {
// Setting Frame Properties
setLayout(null);
setTitle("Transactions");
setSize(900, 830);
setLocation(350, 15);
getContentPane().setBackground(Color.WHITE);
setVisible(true);
// ATM Image
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("icons/atm.jpg")); // Add image
Image i2 = i1.getImage().getScaledInstance(900, 900, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel imageLabel = new JLabel(i3);
imageLabel.setBounds(00, -30, 900, 900);
add(imageLabel);
// Select Transaction Label
JLabel text = new JLabel("Please select yout Transaction type");
text.setBounds(190, 300, 700, 35);
text.setForeground(Color.WHITE);
text.setFont(new Font("System", Font.BOLD, 16));
imageLabel.add(text);
// Deposit Button
depositBtn = new JButton("Deposit");
depositBtn.setBounds(170, 415, 150, 30);
depositBtn.addActionListener(this);
imageLabel.add(depositBtn);
// Cash witdrawal Button
cashWithdrawBtn = new JButton("Cash Withdrawal");
cashWithdrawBtn.setBounds(355, 415, 150, 30);
cashWithdrawBtn.addActionListener(this);
imageLabel.add(cashWithdrawBtn);
// Fast Cash Button
fastCashBtn = new JButton("Fast Cash");
fastCashBtn.setBounds(170, 450, 150, 30);
fastCashBtn.addActionListener(this);
imageLabel.add(fastCashBtn);
// Mini Statement Button
miniStatementBtn = new JButton("Mini Statement");
miniStatementBtn.setBounds(355, 450, 150, 30);
miniStatementBtn.addActionListener(this);
imageLabel.add(miniStatementBtn);
// Pin Change Button
pinChangeBtn = new JButton("Pin Change");
pinChangeBtn.setBounds(170, 485, 150, 30);
pinChangeBtn.addActionListener(this);
imageLabel.add(pinChangeBtn);
// Balance Enquiry Button
balanceEnquiryBtn = new JButton("Balance Enquiry");
balanceEnquiryBtn.setBounds(355, 485, 150, 30);
balanceEnquiryBtn.addActionListener(this);
imageLabel.add(balanceEnquiryBtn);
// Exit Button
exitBtn = new JButton("Exit");
exitBtn.setBounds(355, 520, 150, 30);
exitBtn.addActionListener(this);
imageLabel.add(exitBtn);
}
@Override
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == depositBtn) {
this.dispose();
Deposits deposit = new Deposits();
deposit.setVisible(true);
} else if (ae.getSource() == cashWithdrawBtn) {
this.dispose();
Withdrawal withdrawal = new Withdrawal();
withdrawal.setVisible(true);
} else if (ae.getSource() == fastCashBtn) {
this.dispose();
FastCash fastcash = new FastCash();
fastcash.setVisible(true);
} else if (ae.getSource() == miniStatementBtn) {
MiniStatement ministatement = new MiniStatement();
ministatement.setVisible(true);
} else if (ae.getSource() == pinChangeBtn) {
this.dispose();
PinChange pinchange = new PinChange();
pinchange.setVisible(true);
} else if (ae.getSource() == balanceEnquiryBtn) {
this.dispose();
BalanceEnquiry balanceEnquiry = new BalanceEnquiry();
balanceEnquiry.setVisible(true);
} else if (ae.getSource() == exitBtn) {
this.dispose();
LogIn login = new LogIn();
login.setVisible(true);
}
}
public static void main(String[] args) {
new Transactions();
}
}