BANK MANAGEMENT SYSTEM PROJECT CODE
A - Below is the source code of the project.
B - Create separate class files for every class.
C - Copy the code of one class (ex: [Link]) and paste
it in Login class file, do it for every class.
1 - Create your first class with name 'conn' and paste
the code below in it
package ASimulatorSystem;
import [Link].*;
public class conn{
Connection c;
Statement s;
public conn(){
try{
[Link]("[Link]");
c =[Link]("jdbc:mysql:///project2","root","");
s =[Link]();
}catch(Exception e){
[Link](e);
/*
Note : package ASimulatorSystem; this line will give error if your package
name is different and make sure your database name is project2.
*/
2 - Create next class with name 'Login' and paste the code below in it
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Login extends JFrame implements ActionListener{
JLabel l1,l2,l3;
JTextField tf1;
JPasswordField pf2;
JButton b1,b2,b3;
Login(){
//Move the text to the center
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("AUTOMATED TELLER MACHINE");
int y = [Link](" ");
int z = getWidth() - x;
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"AUTOMATED TELLER MACHINE");
l1 = new JLabel("WELCOME TO ATM");
[Link](new Font("Osward", [Link], 38));
l2 = new JLabel("Card No:");
[Link](new Font("Raleway", [Link], 28));
l3 = new JLabel("PIN:");
[Link](new Font("Raleway", [Link], 28));
tf1 = new JTextField(15);
pf2 = new JPasswordField(15);
b1 = new JButton("SIGN IN");
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("CLEAR");
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("SIGN UP");
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](175,50,450,200);
add(l1);
[Link](125,150,375,200);
add(l2);
[Link](125,225,375,200);
add(l3);
[Link](new Font("Arial", [Link], 14));
[Link](300,235,230,30);
add(tf1);
[Link](new Font("Arial", [Link], 14));
[Link](300,310,230,30);
add(pf2);
[Link](new Font("Arial", [Link], 14));
[Link](300,400,100,30);
add(b1);
[Link](new Font("Arial", [Link], 14));
[Link](430,400,100,30);
add(b2);
[Link](new Font("Arial", [Link], 14));
[Link](300,450,230,30);
add(b3);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(750,750);
setLocation(500,200);
setVisible(true);
public void actionPerformed(ActionEvent ae){
try{
conn c1 = new conn();
String a = [Link]();
String b = [Link]();
String q = "select * from login where cardno = '"+a+"' and pin = '"+b+"'";
ResultSet rs = [Link](q);
if([Link]()==b1){
if([Link]()){
new Transcations().setVisible(true);
setVisible(false);
}else{
[Link](null, "Incorrect Card Number or
Password");
}else if([Link]()==b2){
[Link]("");
[Link]("");
}else if([Link]()==b3){
new Signup().setVisible(true);
setVisible(false);
}catch(Exception e){
[Link]();
[Link]("error: "+e);
}
public static void main(String[] args){
new Login().setVisible(true);
/*
Note : Make sure your name of class, file name and constructor name should be
same and start with
capital 'L' in Login.
*/
3 - Create next class with name 'Signup'
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Signup extends JFrame implements ActionListener{
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12,l13,l14,l15;
JTextField t1,t2,t3,t4,t5,t6,t7;
JRadioButton r1,r2,r3,r4,r5;
JButton b;
JComboBox c1,c2,c3;
Random ran = new Random();
long first4 = ([Link]() % 9000L) + 1000L;
long first = [Link](first4);
Signup(){
//Move the text to the center
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("NEW ACCOUNT APPLICATION FORM");
int y = [Link](" ");
int z = getWidth() - x;
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"NEW ACCOUNT APPLICATION FORM");
l1 = new JLabel("APPLICATION FORM NO. "+first);
[Link](new Font("Raleway", [Link], 38));
l2 = new JLabel("Page 1: Personal Details");
[Link](new Font("Raleway", [Link], 22));
l3 = new JLabel("Name:");
[Link](new Font("Raleway", [Link], 20));
l4 = new JLabel("Father's Name:");
[Link](new Font("Raleway", [Link], 20));
l5 = new JLabel("Date of Birth:");
[Link](new Font("Raleway", [Link], 20));
l6 = new JLabel("Gender:");
[Link](new Font("Raleway", [Link], 20));
l7 = new JLabel("Email Address:");
[Link](new Font("Raleway", [Link], 20));
l8 = new JLabel("Marital Status:");
[Link](new Font("Raleway", [Link], 20));
l9 = new JLabel("Address:");
[Link](new Font("Raleway", [Link], 20));
l10 = new JLabel("City:");
[Link](new Font("Raleway", [Link], 20));
l11 = new JLabel("Pin Code:");
[Link](new Font("Raleway", [Link], 20));
l12 = new JLabel("State:");
[Link](new Font("Raleway", [Link], 20));
l13 = new JLabel("Date");
[Link](new Font("Raleway", [Link], 14));
l14 = new JLabel("Month");
[Link](new Font("Raleway", [Link], 14));
l15 = new JLabel("Year");
[Link](new Font("Raleway", [Link], 14));
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t2 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t3 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t4 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t5 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t6 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t7 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
b = new JButton("Next");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
[Link]([Link]);
r1 = new JRadioButton("Male");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r2 = new JRadioButton("Female");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r3 = new JRadioButton("Married");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r4 = new JRadioButton("Unmarried");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r5 = new JRadioButton("Other");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
String date[] = {"1","2","3","4","5","6","7","8","9"};
c1 = new JComboBox(date);
[Link]([Link]);
String month[] =
{"January","February","March","April","May","June","July","August","Septemb
er","October","November","December"};
c2 = new JComboBox(month);
[Link]([Link]);
String year[] =
{"1990","1991","1992","1993","1994","1995","1996","1997","1998","1999","20
00","2001","2002"};
c3 = new JComboBox(year);
[Link]([Link]);
setLayout(null);
[Link](140,20,600,40);
add(l1);
[Link](290,70,600,30);
add(l2);
[Link](100,140,100,30);
add(l3);
[Link](300,140,400,30);
add(t1);
[Link](100,190,200,30);
add(l4);
[Link](300,190,400,30);
add(t2);
[Link](100,240,200,30);
add(l5);
[Link](300,240,40,30);
add(l13);
[Link](340,240,60,30);
add(c1);
[Link](410,240,50,30);
add(l14);
[Link](460,240,100,30);
add(c2);
[Link](570,240,40,30);
add(l15);
[Link](610,240,90,30);
add(c3);
[Link](100,290,200,30);
add(l6);
[Link](300,290,60,30);
add(r1);
[Link](450,290,90,30);
add(r2);
[Link](100,340,200,30);
add(l7);
[Link](300,340,400,30);
add(t3);
[Link](100,390,200,30);
add(l8);
[Link](300,390,100,30);
add(r3);
[Link](450,390,100,30);
add(r4);
[Link](635,390,100,30);
add(r5);
[Link](100,440,200,30);
add(l9);
[Link](300,440,400,30);
add(t4);
[Link](100,490,200,30);
add(l10);
[Link](300,490,400,30);
add(t5);
[Link](100,540,200,30);
add(l11);
[Link](300,540,400,30);
add(t6);
[Link](100,590,200,30);
add(l12);
[Link](300,590,400,30);
add(t7);
[Link](620,660,80,30);
add(b);
[Link](this);
getContentPane().setBackground([Link]);
setSize(850,850);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
String a = [Link]();
String b = [Link]();
String ac = (String)[Link]();
String bc = (String)[Link]();
String cc = (String)[Link]();
String d = null;
if([Link]()){
d = "Male";
else if([Link]()){
d = "Female";
String e = [Link]();
String f = null;
if([Link]()){
f = "Married";
}else if([Link]()){
f = "Unmarried";
}else if([Link]()){
f = "Other";
}
String g = [Link]();
String h = [Link]();
String i = [Link]();
String j = [Link]();
try{
if([Link]().equals("")){
[Link](null, "Fill all the required fields");
}else{
conn c1 = new conn();
String q1 = "insert into signup
values('"+a+"','"+b+"','"+ac+"','"+bc+"','"+cc+"','"+d+"','"+e+"','"+f+"','"+g+"','"+
h+"','"+i+"','"+j+"','"+first+"')";
[Link](q1);
new Signup2().setVisible(true);
setVisible(false);
}
}catch(Exception ex){
[Link]();
public static void main(String[] args){
new Signup().setVisible(true);
/*
Note : Your database should be connected properly, tables should be made
properly else it will not go to the next frame.
*/
4 - Create next class with name 'Signup2'
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Signup2 extends JFrame implements ActionListener{
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11,l12;
JButton b;
JRadioButton r1,r2,r3,r4;
JTextField t1,t2,t3;
JComboBox c1,c2,c3,c4,c5;
Signup2(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("NEW ACCOUNT APPLICATION FORM - PAGE 2");
int y = [Link](" ");
int z = getWidth()/2 - (x/2);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"NEW ACCOUNT APPLICATION FORM - PAGE 2");
l1 = new JLabel("Page 2: Additonal Details");
[Link](new Font("Raleway", [Link], 22));
l2 = new JLabel("Religion:");
[Link](new Font("Raleway", [Link], 18));
l3 = new JLabel("Category:");
[Link](new Font("Raleway", [Link], 18));
l4 = new JLabel("Income:");
[Link](new Font("Raleway", [Link], 18));
l5 = new JLabel("Educational");
[Link](new Font("Raleway", [Link], 18));
l11 = new JLabel("Qualification:");
[Link](new Font("Raleway", [Link], 18));
l6 = new JLabel("Occupation:");
[Link](new Font("Raleway", [Link], 18));
l7 = new JLabel("PAN Number:");
[Link](new Font("Raleway", [Link], 18));
l8 = new JLabel("Aadhar Number:");
[Link](new Font("Raleway", [Link], 18));
l9 = new JLabel("Senior Citizen:");
[Link](new Font("Raleway", [Link], 18));
l10 = new JLabel("Existing Account:");
[Link](new Font("Raleway", [Link], 18));
l12 = new JLabel("Form No:");
[Link](new Font("Raleway", [Link], 13));
b = new JButton("Next");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
[Link]([Link]);
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t2 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
t3 = new JTextField();
[Link](new Font("Raleway", [Link], 13));
r1 = new JRadioButton("Yes");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r2 = new JRadioButton("No");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r3 = new JRadioButton("Yes");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
r4 = new JRadioButton("No");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
String religion[] = {"Hindu","Muslim","Sikh","Christian","Other"};
c1 = new JComboBox(religion);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 14));
String category[] = {"General","OBC","SC","ST","Other"};
c2 = new JComboBox(category);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 14));
String income[] = {"Null","<1,50,000","<2,50,000","<5,00,000","Upto
10,00,000","Above 10,00,000"};
c3 = new JComboBox(income);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 14));
String education[] = {"Non-Graduate","Graduate","Post-
Graduate","Doctrate","Others"};
c4 = new JComboBox(education);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 14));
String occupation[] = {"Salaried","Self-
Employmed","Business","Student","Retired","Others"};
c5 = new JComboBox(occupation);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 14));
setLayout(null);
[Link](700,10,60,30);
add(l12);
[Link](760,10,60,30);
add(t3);
[Link](280,30,600,40);
add(l1);
[Link](100,120,100,30);
add(l2);
[Link](350,120,320,30);
add(c1);
[Link](100,170,100,30);
add(l3);
[Link](350,170,320,30);
add(c2);
[Link](100,220,100,30);
add(l4);
[Link](350,220,320,30);
add(c3);
[Link](100,270,150,30);
add(l5);
[Link](350,270,320,30);
add(c4);
[Link](100,290,150,30);
add(l11);
[Link](100,340,150,30);
add(l6);
[Link](350,340,320,30);
add(c5);
[Link](100,390,150,30);
add(l7);
[Link](350,390,320,30);
add(t1);
[Link](100,440,180,30);
add(l8);
[Link](350,440,320,30);
add(t2);
[Link](100,490,150,30);
add(l9);
[Link](350,490,100,30);
add(r1);
[Link](460,490,100,30);
add(r2);
[Link](100,540,180,30);
add(l10);
[Link](350,540,100,30);
add(r3);
[Link](460,540,100,30);
add(r4);
[Link](570,600,100,30);
add(b);
[Link](this);
getContentPane().setBackground([Link]);
setSize(850,850);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
String a = (String)[Link]();
String b = (String)[Link]();
String c = (String)[Link]();
String d = (String)[Link]();
String e = (String)[Link]();
String f = [Link]();
String g = [Link]();
String h = "";
if([Link]()){
h = "Yes";
}
else if([Link]()){
h = "No";
String i = "";
if([Link]()){
i = "Yes";
}else if([Link]()){
i = "No";
String j = [Link]();
try{
if([Link]().equals("")){
[Link](null, "Fill all the required fields");
}else{
conn c1 = new conn();
String q1 = "insert into signup2
values('"+a+"','"+b+"','"+c+"','"+d+"','"+e+"','"+f+"','"+g+"','"+h+"','"+i+"','"+j+"')
";
[Link](q1);
new Signup3().setVisible(true);
setVisible(false);
}catch(Exception ex){
[Link]();
public static void main(String[] args){
new Signup2().setVisible(true);
}
}
5 - Create next class with name 'Signup3'
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Signup3 extends JFrame implements ActionListener{
JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,l11;
JRadioButton r1,r2,r3,r4;
JButton b1,b2;
JCheckBox c1,c2,c3,c4,c5,c6,c7;
JTextField t1;
Signup3(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("NEW ACCOUNT APPLICATION FORM - PAGE 3");
int y = [Link](" ");
int z = getWidth()/2 - (x/2);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"NEW ACCOUNT APPLICATION FORM - PAGE 3");
l1 = new JLabel("Page 3: Account Details");
[Link](new Font("Raleway", [Link], 22));
l2 = new JLabel("Account Type:");
[Link](new Font("Raleway", [Link], 18));
l3 = new JLabel("Card Number:");
[Link](new Font("Raleway", [Link], 18));
l4 = new JLabel("XXXX-XXXX-XXXX-4184");
[Link](new Font("Raleway", [Link], 18));
l5 = new JLabel("(Your 16-digit Card number)");
[Link](new Font("Raleway", [Link], 12));
l6 = new JLabel("It would appear on ATM Card/Cheque Book and
Statements");
[Link](new Font("Raleway", [Link], 12));
l7 = new JLabel("PIN:");
[Link](new Font("Raleway", [Link], 18));
l8 = new JLabel("XXXX");
[Link](new Font("Raleway", [Link], 18));
l9 = new JLabel("(4-digit password)");
[Link](new Font("Raleway", [Link], 12));
l10 = new JLabel("Services Required:");
[Link](new Font("Raleway", [Link], 18));
l11 = new JLabel("Form No:");
[Link](new Font("Raleway", [Link], 14));
b1 = new JButton("Submit");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("Cancel");
[Link](new Font("Raleway", [Link], 14));
[Link]([Link]);
[Link]([Link]);
c1 = new JCheckBox("ATM CARD");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c2 = new JCheckBox("Internet Banking");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c3 = new JCheckBox("Mobile Banking");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c4 = new JCheckBox("EMAIL Alerts");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c5 = new JCheckBox("Cheque Book");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c6 = new JCheckBox("E-Statement");
[Link]([Link]);
[Link](new Font("Raleway", [Link], 16));
c7 = new JCheckBox("I hereby declares that the above entered details
correct to th best of my knowledge.",true);
[Link]([Link]);
[Link](new Font("Raleway", [Link], 12));
r1 = new JRadioButton("Saving Account");
[Link](new Font("Raleway", [Link], 16));
[Link]([Link]);
r2 = new JRadioButton("Fixed Deposit Account");
[Link](new Font("Raleway", [Link], 16));
[Link]([Link]);
r3 = new JRadioButton("Current Account");
[Link](new Font("Raleway", [Link], 16));
[Link]([Link]);
r4 = new JRadioButton("Recurring Deposit Account");
[Link](new Font("Raleway", [Link], 16));
[Link]([Link]);
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 12));
setLayout(null);
[Link](700,10,70,30);
add(l11);
[Link](770,10,40,30);
add(t1);
[Link](280,50,400,40);
add(l1);
[Link](100,140,200,30);
add(l2);
[Link](100,180,150,30);
add(r1);
[Link](350,180,300,30);
add(r2);
[Link](100,220,250,30);
add(r3);
[Link](350,220,250,30);
add(r4);
[Link](100,300,200,30);
add(l3);
[Link](330,300,250,30);
add(l4);
[Link](100,330,200,20);
add(l5);
[Link](330,330,500,20);
add(l6);
[Link](100,370,200,30);
add(l7);
[Link](330,370,200,30);
add(l8);
[Link](100,400,200,20);
add(l9);
[Link](100,450,200,30);
add(l10);
[Link](100,500,200,30);
add(c1);
[Link](350,500,200,30);
add(c2);
[Link](100,550,200,30);
add(c3);
[Link](350,550,200,30);
add(c4);
[Link](100,600,200,30);
add(c5);
[Link](350,600,200,30);
add(c6);
[Link](100,680,600,20);
add(c7);
[Link](300,720,100,30);
add(b1);
[Link](420,720,100,30);
add(b2);
getContentPane().setBackground([Link]);
setSize(850,850);
setLocation(500,90);
setVisible(true);
[Link](this);
[Link](this);
public void actionPerformed(ActionEvent ae){
String a = null;
if([Link]()){
a = "Saving Account";
else if([Link]()){
a = "Fixed Deposit Account";
else if([Link]()){
a = "Current Account";
}else if([Link]()){
a = "Recurring Deposit Account";
}
Random ran = new Random();
long first7 = ([Link]() % 90000000L) + 5040936000000000L;
long first8 = [Link](first7);
long first3 = ([Link]() % 9000L) + 1000L;
long first4 = [Link](first3);
String b = "";
if([Link]()){
b = b+" ATM Card";
if([Link]()){
b = b+" Internet Banking";
if([Link]()){
b = b+" Mobile Banking";
if([Link]()){
b = b+" EMAIL Alerts";
if([Link]()){
b = b+" Cheque Book";
}
if([Link]()){
b = b+" E-Statement";
String c = [Link]();
try{
if([Link]()==b1){
if([Link]("")){
[Link](null, "Fill all the required fields");
}else{
conn c1 = new conn();
String q1 = "insert into signup3
values('"+a+"','"+first8+"','"+first4+"','"+b+"','"+c+"')";
String q2 = "insert into login values('"+first8+"','"+first4+"')";
[Link](q1);
[Link](q2);
[Link](null, "Card Number: " + first8 + "\n
Pin:"+ first4);
new Deposit().setVisible(true);
setVisible(false);
}else if([Link]()==b2){
[Link](0);
}catch(Exception ex){
[Link]();
public static void main(String[] args){
new Signup3().setVisible(true);
}
6 - Create next class with name 'Transactions'. This is also your main class after
Login and Signup.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link];
import [Link];
public class Transcations extends JFrame implements ActionListener{
JLabel l1;
JButton b1,b2,b3,b4,b5,b6,b7;
Transcations(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("TRANSACTION");
int y = [Link](" ");
int z = getWidth() - (3*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"TRANSACTION");
l1 = new JLabel("Please Select Your Transaction");
[Link](new Font("System", [Link], 38));
b1 = new JButton("DEPOSIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("CASH WITHDRAWL");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("FAST CASH");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b4 = new JButton("MINI STATEMENT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b5 = new JButton("PIN CHANGE");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b6 = new JButton("BALANCE ENQUIRY");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b7 = new JButton("EXIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](100,100,700,40);
add(l1);
[Link](40,250,300,60);
add(b1);
[Link](440,250,300,60);
add(b2);
[Link](40,360,300,60);
add(b3);
[Link](440,360,300,60);
add(b4);
[Link](40,470,300,60);
add(b5);
[Link](440,470,300,60);
add(b6);
[Link](240,600,300,60);
add(b7);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
if([Link]()==b1){
new Deposit().setVisible(true);
setVisible(false);
}
else if([Link]()==b2){
new Withdrawl().setVisible(true);
setVisible(false);
else if([Link]()==b3){
new FastCash().setVisible(true);
setVisible(false);
}else if([Link]()==b4){
new Login().setVisible(true);
setVisible(false);
}else if([Link]()==b5){
new Pin().setVisible(true);
setVisible(false);
}else if([Link]()==b6){
String pinn = [Link]("Enter PIN");
conn c1 = new conn();
try {
ResultSet rs = [Link](" SELECT balance FROM bank ORDER
BY pin = '"+pinn+"' DESC LIMIT 1");
if([Link]()){
String balance = [Link]("balance");
[Link](null,"Your Account Balance is
"+balance);
} catch (Exception e) {
[Link]();
}else if([Link]()==b7){
[Link](0);
public static void main(String[] args){
new Transcations().setVisible(true);
}
7 - Create next class with name 'Deposit'. This frame will open from the
Transaction frame.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Deposit extends JFrame implements ActionListener{
JTextField t1,t2;
JButton b1,b2,b3;
JLabel l1,l2,l3;
Deposit(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("DEPOSIT");
int y = [Link](" ");
int z = getWidth() - (5*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"DEPOSIT");
l1 = new JLabel("ENTER AMOUNT YOU WANT");
[Link](new Font("System", [Link], 35));
l2 = new JLabel("TO DEPOSIT");
[Link](new Font("System", [Link], 35));
l3 = new JLabel("Enter Pin");
[Link](new Font("System", [Link], 14));
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 22));
t2 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
b1 = new JButton("DEPOSIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("BACK");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("EXIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](620,10,80,30);
add(l3);
[Link](700,10,40,30);
add(t2);
[Link](150,150,800,60);
add(l1);
[Link](290,210,800,60);
add(l2);
[Link](250,300,300,50);
add(t1);
[Link](260,380,125,50);
add(b1);
[Link](415,380,125,50);
add(b2);
[Link](300,550,200,50);
add(b3);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
try{
String a = [Link]();
String b = [Link]();
if([Link]()==b1){
if([Link]().equals("")){
[Link](null, "Please enter the Amount to
you want to Deposit");
}else{
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+b+"' ");
double balance = 0;
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
double d = [Link](a);
balance+=d;
String q1= "insert into bank
values('"+pin+"','"+d+"',null,'"+balance+"')";
[Link](q1);
[Link](null, "Rs. "+a+" Deposited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
}
}else if([Link]()==b2){
new Transcations().setVisible(true);
setVisible(false);
}else if([Link]()==b3){
[Link](0);
}catch(Exception e){
[Link]();
[Link]("error: "+e);
public static void main(String[] args){
new Deposit().setVisible(true);
}
}
8 - Create next class with name 'deposit1'. This frame will open just after signup
completes.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link];
import [Link].*;
public class deposit1 extends JFrame implements ActionListener{
JTextField t1,t2;
JButton b1,b2,b3;
JLabel l1,l2,l3;
deposit1(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("DEPOSIT");
int y = [Link](" ");
int z = getWidth() - (5*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"DEPOSIT");
l1 = new JLabel("ENTER AMOUNT YOU WANT");
[Link](new Font("System", [Link], 35));
l2 = new JLabel("TO DEPOSIT");
[Link](new Font("System", [Link], 35));
l3 = new JLabel("Enter Pin");
[Link](new Font("System", [Link], 14));
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 22));
t2 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
b1 = new JButton("DEPOSIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("BACK");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("EXIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](620,10,80,30);
add(l3);
[Link](700,10,40,30);
add(t2);
[Link](150,150,800,60);
add(l1);
[Link](290,210,800,60);
add(l2);
[Link](250,300,300,50);
add(t1);
[Link](260,380,125,50);
add(b1);
[Link](415,380,125,50);
add(b2);
[Link](300,550,200,50);
add(b3);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
try{
String a = [Link]();
String b = [Link]();
if([Link]()==b1){
if([Link]().equals("")){
[Link](null, "Please enter the Amount to
you want to Deposit");
}else{
conn c1 = new conn();
String q1= "insert into bank values('"+b+"','"+a+"',null,'"+a+"')";
[Link](q1);
[Link](null, "Rs. "+a+" Deposited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
}else if([Link]()==b2){
new Transcations().setVisible(true);
setVisible(false);
}else if([Link]()==b3){
[Link](0);
}
}catch(Exception e){
[Link]();
[Link]("error: "+e);
public static void main(String[] args){
new deposit1().setVisible(true);
/*
Note : There are two deposit classes. Open will open just after you completes
signup and other will get open after you click Deposit button on Transaction
frame
*/
9 - Create next class with name 'Withdrawl'.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Withdrawl extends JFrame implements ActionListener{
JTextField t1,t2;
JButton b1,b2,b3;
JLabel l1,l2,l3,l4;
Withdrawl(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("WITHDRAWAL");
int y = [Link](" ");
int z = getWidth() - (3*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"WITHDRAWAL");
l1 = new JLabel("MAXIMUM DAILY WITHDRAWAL");
[Link](new Font("System", [Link], 40));
l2 = new JLabel("IS RS.10,000");
[Link](new Font("System", [Link], 40));
l3 = new JLabel("PLEASE ENTER YOUR AMOUNT");
[Link](new Font("System", [Link], 35));
l4 = new JLabel("Enter Pin");
[Link](new Font("System", [Link], 14));
t1 = new JTextField();
[Link](new Font("Raleway", [Link], 22));
t2 = new JTextField();
[Link](new Font("Raleway", [Link], 14));
b1 = new JButton("WITHDRAW");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("BACK");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("EXIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](620,10,80,30);
add(l4);
[Link](700,10,40,30);
add(t2);
[Link](90,100,800,60);
add(l1);
[Link](270,160,800,60);
add(l2);
[Link](120,260,800,60);
add(l3);
[Link](210,340,360,50);
add(t1);
[Link](220,400,160,50);
add(b1);
[Link](400,400,160,50);
add(b2);
[Link](300,550,200,50);
add(b3);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
try{
String a = [Link]();
String b = [Link]();
if([Link]()==b1){
if([Link]().equals("")){
[Link](null, "Please enter the Amount to
you want to Withdraw");
}else{
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+b+"' ");
double balance = 0;
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
double d = [Link](a);
balance-=d;
String q1= "insert into bank
values('"+pin+"',null,'"+d+"','"+balance+"')";
[Link](q1);
}
[Link](null, "Rs. "+a+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
}else if([Link]()==b2){
new Transcations().setVisible(true);
setVisible(false);
}else if([Link]()==b3){
[Link](0);
}catch(Exception e){
[Link]();
[Link]("error: "+e);
public static void main(String[] args){
new Withdrawl().setVisible(true);
10 - Create next class with name 'FastCash'.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class FastCash extends JFrame implements ActionListener{
JLabel l1,l2;
JButton b1,b2,b3,b4,b5,b6,b7,b8;
JTextField t1;
FastCash(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("FAST CASH");
int y = [Link](" ");
int z = getWidth() - (4*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"FAST CASH");
l1 = new JLabel("SELECT WITHDRAWL AMOUNT");
[Link](new Font("System", [Link], 38));
l2 = new JLabel("Enter PIN");
[Link](new Font("System", [Link], 13));
t1 = new JTextField();
[Link](new Font("System", [Link], 13));
b1 = new JButton("Rs 100");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("Rs 500");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b3 = new JButton("Rs 1000");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b4 = new JButton("Rs 2000");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b5 = new JButton("Rs 5000");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b6 = new JButton("Rs 10000");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b7 = new JButton("BACK");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b7 = new JButton("EXIT");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
setLayout(null);
[Link](640,10,60,40);
add(l2);
[Link](710,10,60,40);
add(t1);
[Link](100,100,700,40);
add(l1);
[Link](40,250,300,60);
add(b1);
[Link](440,250,300,60);
add(b2);
[Link](40,360,300,60);
add(b3);
[Link](440,360,300,60);
add(b4);
[Link](40,470,300,60);
add(b5);
[Link](440,470,300,60);
add(b6);
[Link](240,600,300,60);
add(b7);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
[Link](this);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
}
public void actionPerformed(ActionEvent ae){
try{
String a = [Link]();
double balance = 0;
if([Link]()==b1){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=100;
String q1= "insert into bank
values('"+pin+"',null,100,'"+balance+"')";
[Link](q1);
[Link](null, "Rs. "+100+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
else if([Link]()==b2){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=500;
String q1= "insert into bank
values('"+pin+"',null,500,'"+balance+"')";
[Link](q1);
[Link](null, "Rs. "+500+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
}
else if([Link]()==b3){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=1000;
String q1= "insert into bank
values('"+pin+"',null,1000,'"+balance+"')";
[Link](q1);
}
[Link](null, "Rs. "+1000+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
else if([Link]()==b4){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=2000;
String q1= "insert into bank
values('"+pin+"',null,2000,'"+balance+"')";
[Link](q1);
[Link](null, "Rs. "+2000+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
}
else if([Link]()==b5){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=5000;
String q1= "insert into bank
values('"+pin+"',null,5000,'"+balance+"')";
[Link](q1);
}
[Link](null, "Rs. "+5000+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
else if([Link]()==b6){
conn c1 = new conn();
ResultSet rs = [Link](" select * from bank where pin =
'"+a+"' ");
if([Link]()){
String pin = [Link]("pin");
balance = [Link]("balance");
balance-=10000;
String q1= "insert into bank
values('"+pin+"',null,10000,'"+balance+"')";
[Link](q1);
[Link](null, "Rs. "+10000+" Debited
Successfully");
new Transcations().setVisible(true);
setVisible(false);
else if([Link]()==b7){
[Link](0);
}catch(Exception e){
[Link]();
[Link]("error: "+e);
public static void main(String[] args){
new FastCash().setVisible(true);
11 - Create a class with name 'Pin'.
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class Pin extends JFrame implements ActionListener{
JPasswordField t1,t2,t3;
JButton b1,b2;
JLabel l1,l2,l3,l4;
Pin(){
setFont(new Font("System", [Link], 22));
Font f = getFont();
FontMetrics fm = getFontMetrics(f);
int x = [Link]("PIN CHANGE");
int y = [Link](" ");
int z = getWidth() - (3*x);
int w = z/y;
String pad ="";
//for (int i=0; i!=w; i++) pad +=" ";
pad = [Link]("%"+w+"s", pad);
setTitle(pad+"PIN CHANGE");
l1 = new JLabel("CHANGE YOUR PIN");
[Link](new Font("System", [Link], 35));
l2 = new JLabel("Current PIN:");
[Link](new Font("System", [Link], 22));
l3 = new JLabel("New PIN:");
[Link](new Font("System", [Link], 22));
l4 = new JLabel("Re-Enter New PIN:");
[Link](new Font("System", [Link], 22));
t1 = new JPasswordField();
[Link](new Font("Raleway", [Link], 22));
t2 = new JPasswordField();
[Link](new Font("Raleway", [Link], 22));
t3 = new JPasswordField();
[Link](new Font("Raleway", [Link], 22));
b1 = new JButton("SAVE");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
b2 = new JButton("BACK");
[Link](new Font("System", [Link], 18));
[Link]([Link]);
[Link]([Link]);
[Link](this);
[Link](this);
setLayout(null);
[Link](220,130,800,60);
add(l1);
[Link](100,240,150,40);
add(l2);
[Link](100,300,150,40);
add(l3);
[Link](100,360,200,40);
add(l4);
[Link](310,240,360,40);
add(t1);
[Link](310,300,360,40);
add(t2);
[Link](310,360,360,40);
add(t3);
[Link](220,460,160,50);
add(b1);
[Link](400,460,160,50);
add(b2);
getContentPane().setBackground([Link]);
setSize(800,800);
setLocation(500,90);
setVisible(true);
public void actionPerformed(ActionEvent ae){
try{
String a = [Link]();
String b = [Link]();
String c = [Link]();
if([Link]()==b1){
if([Link]().equals("")){
[Link](null, "Please Enter Current PIN");
if([Link]().equals("")){
[Link](null, "Enter New PIN");
if ([Link]().equals("")){
[Link](null, "Re-Enter new PIN");
if([Link]().equals([Link]())){
conn c1 = new conn();
String q1 = "update bank set pin = '"+b+"' where pin = '"+a+"' ";
String q2 = "update login set pin = '"+b+"' where pin = '"+a+"' ";
String q3 = "update signup3 set pin = '"+b+"' where pin = '"+a+"' ";
[Link](q1);
[Link](q2);
[Link](q3);
[Link](null, "PIN changed successfully");
new Transcations().setVisible(true);
setVisible(false);
}else{
[Link](null, "PIN entered doesn't match");
}
}else if([Link]()==b2){
new Transcations().setVisible(true);
setVisible(false);
}catch(Exception e){
[Link]();
[Link]("error: "+e);
public static void main(String[] args){
new Pin().setVisible(true);
}
12 - Create next class with name "MiniStatement"
package ASimulatorSystem;
import [Link].*;
import [Link].*;
import [Link].*;
import [Link].*;
public class MiniStatement extends JFrame implements ActionListener{
JTable t1;
JButton b1;
String x[] = {"Customer Name","Date","Deposit","Withdraw","Balance"};
String y[][] = new String[20][5];
int i=0, j=0;
MiniStatement(){
super("Mini Statement");
setSize(1200,650);
setLocation(200,200);
try{
conn c1 = new conn();
String s1 = "select * from bank";
ResultSet rs = [Link](s1);
while([Link]()){
y[i][j++]=[Link]("customer_name");
y[i][j++]=[Link]("date");
y[i][j++]=[Link]("deposit");
y[i][j++]=[Link]("withdraw");
y[i][j++]=[Link]("balance");
i++;
j=0;
t1 = new JTable(y,x);
}catch(Exception e){
[Link]();
b1 = new JButton("Print");
add(b1,"South");
JScrollPane sp = new JScrollPane(t1);
add(sp);
[Link](this);
public void actionPerformed(ActionEvent ae){
try{
[Link]();
}catch(Exception e){}
public static void main(String[] args){
new MiniStatement().setVisible(true);
Code for Interview
Author & Editor
Has laoreet percipitur ad. Vide interesset in mei, no his legimus verterem. Et
nostrum imperdiet appellantur usu, mnesarchum referrentur id vim.
2:30 PM