package bank.
management;
import [Link].*;
import [Link].*;
import [Link];
import [Link];
import [Link];
public class Deposit extends JFrame implements ActionListener {
String pin;
JTextField textfield;
JButton b1, b2;
Deposit(String pin) {
[Link] = pin;
// Load background image
ImageIcon i1 = new ImageIcon([Link]("icon/[Link]"));
Image i2 = [Link]().getScaledInstance(1550, 830, Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
[Link](0, 0, 1550, 830);
add(image);
// Label for the amount input field
JLabel l1 = new JLabel("ENTER THE AMOUNT YOU WANT TO DEPOSIT");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
[Link](460, 180, 400, 35);
[Link](l1);
// Amount input field
textfield = new JTextField();
[Link](new Color(65, 125, 128));
[Link]([Link]);
[Link](460, 230, 320, 25);
[Link](new Font("Raleway", [Link], 22));
[Link](textfield);
// Deposit button
b1 = new JButton("DEPOSIT");
[Link](700, 362, 150, 35);
[Link](new Color(65, 125, 128));
[Link]([Link]);
[Link](this);
[Link](b1);
// Back button
b2 = new JButton("BACK");
[Link](700, 406, 150, 35);
[Link](new Color(65, 125, 128));
[Link]([Link]);
[Link](this);
[Link](b2);
setLayout(null);
setSize(1550, 1080);
setLocation(0, 0);
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
try {
String amount = [Link]();
Date date = new Date();
if ([Link]() == b1) {
if ([Link]().equals("")) {
[Link](null, "Please enter the amount you want to
deposit");
} else {
Con c = new Con();
// Fixed SQL syntax error: Corrected the query string
String query = "INSERT INTO bank (pin, date, type, amount) VALUES ('" + pin + "',
'" + date + "', 'Deposit', '" + amount + "')";
[Link](query);
[Link](null, "Rs. " + amount + " deposited
successfully");
setVisible(false);
}
} else if ([Link]() == b2) {
setVisible(false);
}
} catch (Exception ex) {
[Link]();
}
}
public static void main(String[] args) {
new Deposit("");
}
}