main_class java project
main_class java project
management;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
main_Class(String pin) {
this.pin = pin;
// Deposit button
b1 = new JButton("DEPOSIT");
b1.setBounds(410, 274, 150, 35);
b1.setBackground(new Color(65, 125, 128));
b1.setForeground(Color.WHITE);
b1.addActionListener(this);
image.add(b1);
// Cash withdraw
b2 = new JButton("CASH WITHDRAW");
b2.setBounds(700, 274, 150, 35);
b2.setBackground(new Color(65, 125, 128));
b2.setForeground(Color.WHITE);
b2.addActionListener(this);
image.add(b2);
// Fast cash
b3 = new JButton("FAST CASH");
b3.setBounds(410, 318, 150, 35);
b3.setBackground(new Color(65, 125, 128));
b3.setForeground(Color.WHITE);
b3.addActionListener(this);
image.add(b3);
// Mini statement
b4 = new JButton("MINI STATEMENT");
b4.setBounds(700, 318, 150, 35);
b4.setBackground(new Color(65, 125, 128));
b4.setForeground(Color.WHITE);
b4.addActionListener(this);
image.add(b4);
// Pin change
b5 = new JButton("PIN CHANGE");
b5.setBounds(410, 362, 150, 35);
b5.setBackground(new Color(65, 125, 128));
b5.setForeground(Color.WHITE);
b5.addActionListener(this);
image.add(b5);
// Balance enquiry
b6 = new JButton("BALANCE ENQUIRY");
b6.setBounds(700, 362, 150, 35);
b6.setBackground(new Color(65, 125, 128));
b6.setForeground(Color.WHITE);
b6.addActionListener(this);
image.add(b6);
// Exit
b7 = new JButton("EXIT");
b7.setBounds(700, 406, 150, 35);
b7.setBackground(new Color(65, 125, 128));
b7.setForeground(Color.WHITE);
b7.addActionListener(this);
image.add(b7);
setLayout(null);
setSize(1550, 1080);
setLocation(0, 0);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == b1) {
new Deposit(pin);
} else if (e.getSource() == b2) {
// Add logic for Cash Withdraw
} else if (e.getSource() == b3) {
// Add logic for Fast Cash
} else if (e.getSource() == b4) {
// Add logic for Mini Statement
} else if (e.getSource() == b5) {
// Add logic for Pin Change
} else if (e.getSource() == b6) {
// Add logic for Balance Enquiry
} else if (e.getSource() == b7) {
System.exit(0);
}
}