-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDeposit.java
More file actions
92 lines (86 loc) · 2.83 KB
/
Copy pathDeposit.java
File metadata and controls
92 lines (86 loc) · 2.83 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
package src;
import java.awt.color.*;
import java.awt.Component;
import java.awt.font.*;
import java.awt.Image;
import java.awt.LayoutManager;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Date;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JOptionpane;
import javax.swing.JTextField;
public class Deposit extends JFrame implements ActionListener{
JTextField t1 , t2;
JButton b1,b2,b3;
JLabel l1,l2,l3;
String pin;
Deposit(String pin)
{
this.pin = pin;
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("Bank management system/atm.jpg"));
Image i2 = i1.getImage().getScaledInstance(1000, 1180, 1);
ImageIcon i3 = new ImageIcon(i2);
JLabel i3 = newJLabel(i3);
l3.setBounds(0,0,960,1080);
this.add(l3);
this.l1 = newJLabel("ENTER AMOUNT YOU WANT TO DEPOSIT ");
this.l1.setForeground(Color.White);
this.l1.setFont(new Font("System",1,16));
this.t1 = JTextField();
this.t1.setFont(new Font("Raleway",1,22));
this.b1 = new JButton("DEPOSIT");
this.b2 = new JButton("BACk");
this.setLayout((LayoutManager)null);
this.l1.setBounds(190,350,400,35);
l3.add(this.l1);
this.t1.setBounds(getBounds(190,420,320,25));
l3.add(this.l2);
this.b1.setBounds(390,588,150,35);
l3.add(this.b1);
this.b2.setBounds(390,633,150,35);
l3.add(this.b2);
this.b1.addActionListener(this);
this.b2.addActionListener(this);
this.setSize(960,1080);
this.setVisible(true);
}
public void actionPerformed(ActionEvent ae)
{
try {
String amount = this.t1.getText();
Date date = new Date();
if(ae.getSource() == this.b1) {
if(this.t1.getText().equals(""))
{
JOptionPane.showMessageDialog((Component)null,"Please enter the Amount to you want to Deposit");
}
else
{
conn c1 = new Conn();
c1.s.executeUpdate("Insert into bank Values('" + this.pin + "' , ,", "Deposit", + amount + "')");
JOptionPane.showMessageDialog((Component)null, "Rs. "+ amount + "Deposited Successfully");
this.setVisible(false);
(new Transactions(this.pin)).setVisible(true);
}
if (ae.getSource() == this.b2) {
this.setVisible(false);
(new Transactions(this.pin)).setVisible(true);
}
}
}
catch (Exception var5)
{
var5.printStackTrace();
}
}
public static void main(String[] args)
{
(new Deposit("")).setVisible(true);
}
}