-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBalanceEnquiry.java
More file actions
53 lines (45 loc) · 1.63 KB
/
Copy pathBalanceEnquiry.java
File metadata and controls
53 lines (45 loc) · 1.63 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
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 BalanceEnquiry extends JFrame implements ActionListener {
JButton backBtn;
BalanceEnquiry() {
setVisible(true);
setLayout(null);
setSize(900, 830);
setLocation(350, 15);
setTitle("Balance Enquiry");
// 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);
// Back Button
backBtn = new JButton("Back");
backBtn.setBounds(355, 520, 150, 30);
backBtn.setFont(new Font("Raleway", Font.BOLD, 22));
backBtn.addActionListener(this);
imageLabel.add(backBtn);
// Display Bank Balance
JLabel balanceLabel = new JLabel("Your current balance is: ₹XX,999");
balanceLabel.setFont(new Font("Raleway", Font.BOLD, 22));
balanceLabel.setForeground(Color.WHITE);
balanceLabel.setBounds(160, 300, 400, 30);
imageLabel.add(balanceLabel);
}
@Override
public void actionPerformed(ActionEvent ae) {
this.dispose();
Transactions transaction = new Transactions();
transaction.setVisible(true);
}
public static void main(String[] args) {
new BalanceEnquiry();
}
}