-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain_Class.java
147 lines (128 loc) · 4.36 KB
/
main_Class.java
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package bankmanagement;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.sql.Connection;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
/**
*
* @author gbv
*/
public class main_Class extends JFrame implements ActionListener {
private JButton b1,b2,b3,b4,b5,b6,b7;
private String pin;
public void setJButton(JButton newb1,JButton newb2,JButton newb3,JButton newb4,JButton newb5,JButton newb6,JButton newb7){
this.b1=newb1;
this.b2=newb2;
this.b3=newb3;
this.b4=newb4;
this.b5=newb5;
this.b6=newb6;
this.b7=newb7;
}
public JButton getJButton(){
return b1;
}
//setter and getter
public void setPin(String newPin){
this.pin = newPin;
}
public String getterPin(){
return pin;
}
main_Class(String pin){
this.pin = pin;
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("iconn/atm2.png"));
java.awt.Image i2 = i1.getImage().getScaledInstance(1550,830,java.awt.Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel l3 = new JLabel(i3);
l3.setBounds(0,0,1550,830);
add(l3);
JLabel label = new JLabel("Please Select Your Transaction");
label.setBounds(430,180,700,35);
label.setForeground(Color.WHITE);
label.setFont(new Font("System",Font.BOLD,28));
l3.add(label);
b1 = new JButton("DEPOSIT");
b1.setForeground(Color.WHITE);
b1.setBackground(new Color(65,125,128));
b1.setBounds(410,274,150,35);
b1.addActionListener(this);
l3.add(b1);
b2 = new JButton("CASH WITHDRAWL");
b2.setForeground(Color.WHITE);
b2.setBackground(new Color(65,125,128));
b2.setBounds(700,274,150,35);
b2.addActionListener(this);
l3.add(b2);
b3 = new JButton("FAST CASH");
b3.setForeground(Color.WHITE);
b3.setBackground(new Color(65,125,128));
b3.setBounds(410,318,150,35);
b3.addActionListener(this);
l3.add(b3);
b4 = new JButton("MINI STATEMENT");
b4.setForeground(Color.WHITE);
b4.setBackground(new Color(65,125,128));
b4.setBounds(700,318,150,35);
b4.addActionListener(this);
l3.add(b4);
b5 = new JButton("PIN CHANGE");
b5.setForeground(Color.WHITE);
b5.setBackground(new Color(65,125,128));
b5.setBounds(410,362,150,35);
b5.addActionListener(this);
l3.add(b5);
b6 = new JButton("BALANCE ENQUIRY");
b6.setForeground(Color.WHITE);
b6.setBackground(new Color(65,125,128));
b6.setBounds(700,362,150,35);
b6.addActionListener(this);
l3.add(b6);
b7 = new JButton("EXIT");
b7.setForeground(Color.WHITE);
b7.setBackground(new Color(65,125,128));
b7.setBounds(700,406,150,35);
b7.addActionListener(this);
l3.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);
setVisible(false);
}else if (e.getSource()==b7){
new Login();
} else if (e.getSource()==b2) {
new Withdrawl(pin);
setVisible(false);
} else if (e.getSource()==b6) {
new BalanceEnquriy(pin);
setVisible(false);
} else if (e.getSource()==b3) {
new FastCash(pin);
setVisible(false);
} else if (e.getSource()==b5) {
new Pin(pin);
setVisible(false);
} else if (e.getSource()==b4) {
new mini(pin);
}
}
public static void main(String[] args) {
//object to access constructor in Class main_Class
main_Class rt = new main_Class("");
}
}