//=================================================================
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class BankingSystem{
ImageIcon pic1,pic2;
JFrame log, rehistro,lagging,kame;
JTextField user;
JPasswordField pass;
JPanel login,register;
JPanel regreg, loglog;
JLabel lbl;
JButton loginbtn, regbtn;
JButton menubtn;
String bishop;
JComboBox year;
JTextField laman;
JLabel accnt;
JTextField Fname,Mname,Lname;
JLabel n1,n2,n3;
JTextField occupation;
JLabel job;
JLabel kasarian;
JComboBox gen;
JLabel bday,month;
JComboBox birth;
JTextField mobile;
JLabel mobilenum;
JLabel bg1;
JPanel detalye;
JButton aboutbtn,back2;
JLabel detail,detail2,detail3,detail4;
JLabel bg2;
JLabel userRegister;
JTextField userTxtReg;
JButton regButton;
JLabel passRegistration;
JPasswordField passTxtRegistration;
//========================================================================
public BankingSystem(){
//Paglagay ng Frame
log = new JFrame("Barako Bank");
//Para malagyan ng Frame
login = new JPanel();
login.setLayout( null );
//--------------------------------------------------------------------
//Username Label
lbl = new JLabel ("Username: ");
lbl.setFont(new Font("Candara", Font.BOLD, 15));
lbl.setBounds( 95, 140, 200, 20 );
lbl.setForeground(Color.BLACK);
login.add (lbl);
//Eto ung TextField for Username
user = new JTextField (15);
user.setBounds(175,140,150, 20 );
login.add (user);
//-------------------------------------------------------------------
//Password
lbl = new JLabel ("Password: ");
lbl.setFont(new Font("Candara", Font.BOLD, 15));
lbl.setBounds( 95, 170, 200, 20 );
lbl.setForeground(Color.BLACK);
login.add (lbl);
//Eto ung TextField for Password
pass = new JPasswordField (15);
pass.setBounds(175,170,150, 20 );
login.add (pass);
//-------------------------------------------------------------------
//Login Button
loginbtn= new JButton ("Login");
loginbtn.setBackground(Color.yellow);
loginbtn.setFont(new Font("Candara", Font.BOLD, 13));
loginbtn.setBounds(118,200,90, 20 );
LOGIN lg = new LOGIN();
loginbtn.addActionListener(lg);
login.add (loginbtn);
//--------------------------------------------------------------------
//Register Button
regbtn= new JButton ("Register");
regbtn.setBackground(Color.yellow);
regbtn.setFont(new Font("Candara", Font.BOLD, 13));
regbtn.setBounds(225,200,90, 20 );
REGISTER re = new REGISTER();
regbtn.addActionListener(re);
login.add (regbtn);
//-------------------------------------------------------------------
//About Button
aboutbtn= new JButton ("About Us");
//aboutbtn.setBackground(Color.green);
aboutbtn.setFont(new Font("Candara", Font.BOLD, 10));
aboutbtn.setBounds(310,253,75, 15 );
ABOUT ab = new ABOUT();
aboutbtn.addActionListener(ab);
login.add (aboutbtn);
//-------------------------------------------------------------------
//FrameSize - First Page
log.setSize(400,300);//Size ng Frame
log.setLocation(450,250);//kung saan mag popUp ung Frame
log.setVisible(true);//Para makita ung Frame
log.setResizable(false);//Para hindi maresize yung Frame
log.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//para maclose ung Frame
log.setContentPane(login);//Para mailagay ang panel sa Frame //nakalagay sa loob kung anu ung gagamiting Jpanel
//-------------------------------------------------------------------
//Background
pic1 = new ImageIcon("bg1.jpg");
bg1 = new JLabel();
bg1.setIcon(pic1);
bg1.setBounds(35,-115,500,500);
login.add(bg1);
//===================================================================
}
public class ABOUT implements ActionListener{
public void actionPerformed (ActionEvent ae){
log.setVisible(false);
kame = new JFrame("About Us");
detalye = new JPanel();
detalye.setLayout(null);
kame.setSize(350,400);//Size ng Frame
kame.setLocation(500,150);//kung saan mag popUp ung Frame
kame.setVisible(true);//Para makita ung Frame
kame.setResizable(false);//Para hindi maresize yung Frame
kame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//para maclose ung Frame
kame.setContentPane(detalye);
//------------------------------------------------------------
detail = new JLabel ("Barako Bank ");
detail.setFont(new Font("Candara", Font.BOLD, 25));
detail.setBounds( 108, 20, 200, 40 );
detail.setForeground(Color.black);
detalye.add (detail);
detail2 = new JLabel ("Keeping your money is our business ");
detail2.setFont(new Font("Candara", Font.BOLD, 12));
detail2.setBounds( 83, 38, 230, 40 );
detail2.setForeground(Color.DARK_GRAY);
detalye.add (detail2);
detail3 = new JLabel ("Version 1.0.0 ");
detail3.setFont(new Font("Candara", Font.BOLD, 14));
detail3.setBounds( 140, 55, 230, 40 );
detail3.setForeground(Color.black);
detalye.add (detail3);
detail4 = new JLabel ("Created by: Barako Brothers");
detail4.setFont(new Font("Candara", Font.BOLD, 15));
detail4.setBounds( 84, 80, 230, 40 );
detail4.setForeground(Color.black);
detalye.add (detail4);
//-----------------------------------------------------------
//Back Button
back2 = new JButton("Back");
//back2.setBackground(Color.green);
back2.setFont(new Font("Candara", Font.BOLD, 13));
back2.setBounds(248,345,80, 20 );
MENU2 me2 = new MENU2();
back2.addActionListener(me2);
detalye.add (back2);
//-----------------------------------------------------------
pic2 = new ImageIcon("bg3.jpg");
bg2 = new JLabel();
bg2.setIcon(pic2);
bg2.setBounds(0,55,350,350);
detalye.add(bg2);
}
}
//=====================================================================
public class REGISTER implements ActionListener{
public void actionPerformed (ActionEvent ae){
log.setVisible(false);//nakalagay to para mawala ung ung unang Frame
rehistro = new JFrame("REGISTRATION");
regreg = new JPanel();
regreg.setLayout( null );
rehistro.setSize(325,518);//Size ng Frame
rehistro.setLocation(460,100);//kung saan mag popUp ung Frame
rehistro.setVisible(true);//Para makita ung Frame
rehistro.setResizable(false);//Para hindi maresize yung Frame
rehistro.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//para maclose ung Frame
rehistro.setContentPane(regreg);//Para mailagay ang panel sa Frame //nakalagay sa loob kung anu ung gagamiting Jpanel
//----------------------------------------------------------------
//Menu button
menubtn= new JButton ("Back");
menubtn.setBackground(Color.yellow);
menubtn.setFont(new Font("Candara", Font.BOLD, 15));
menubtn.setBounds(200,465,100, 20 );
MENU me = new MENU();
menubtn.addActionListener(me);
regreg.add (menubtn);
//=======================================================================
//Register Details
//First Name
n1 = new JLabel ("First Name");
n1.setFont(new Font("Candara", Font.BOLD, 15));
n1.setBounds( 10, 15, 200, 20 );
n1.setForeground(Color.BLACK);
regreg.add (n1);
//Eto ung TextField for Username
Fname = new JTextField (15);
Fname.setBounds(120,15,180, 20 );
regreg.add (Fname);
//----------------------------------------------------------------------
//Middle Name
n2 = new JLabel ("Middle Name");
n2.setFont(new Font("Candara", Font.BOLD, 15));
n2.setBounds( 10, 45, 200, 20 );
n2.setForeground(Color.BLACK);
regreg.add (n2);
//Eto ung TextField for Username
Mname = new JTextField (15);
Mname.setBounds(120,45,180, 20 );
regreg.add (Mname);
//---------------------------------------------------------------------
//Last Name
n3 = new JLabel ("Last Name");
n3.setFont(new Font("Candara", Font.BOLD, 15));
n3.setBounds( 10, 75, 200, 20 );
n3.setForeground(Color.BLACK);
regreg.add (n3);
//Eto ung TextField for Username
Lname = new JTextField (15);
Lname.setBounds(120,75,180, 20 );
regreg.add (Lname);
//=======================================================================
//Occupation
job = new JLabel ("Occupation");
job.setFont(new Font("Candara", Font.BOLD, 15));
job.setBounds( 10, 105, 200, 20 );
job.setForeground(Color.BLACK);
regreg.add (job);
//Eto ung TextField for Username
occupation = new JTextField (15);
occupation.setBounds(120,105,180, 20 );
regreg.add (occupation);
//-----------------------------------------------------------------------
mobilenum = new JLabel ("Phone Number");
mobilenum.setFont(new Font("Candara", Font.BOLD, 15));
mobilenum.setBounds( 10, 135, 200, 20 );
mobilenum.setForeground(Color.BLACK);
regreg.add (mobilenum);
//Eto ung TextField for Username
mobile = new JTextField (15);
mobile.setBounds(120,135,180, 20 );
regreg.add (mobile);
//----------------------------------------------------------------A------
JTextField edad;
JLabel age;
age = new JLabel ("Age");
age.setFont(new Font("Candara", Font.BOLD, 15));
age.setBounds( 10, 165, 200, 20 );
age.setForeground(Color.BLACK);
regreg.add (age);
//Eto ung TextField for Username
edad = new JTextField (15);
edad.setBounds(45,165,30, 20 );
regreg.add (edad);
//---------------------------------------------------------------------
gen= new JComboBox();
gen.addItem("N/A");
gen.addItem("Male");
gen.addItem("Female");
gen.setBounds(150,165,150,20);
regreg.add(gen);
kasarian = new JLabel ("Gender");
kasarian.setFont(new Font("Candara", Font.BOLD, 15));
kasarian.setBounds( 95, 165, 200, 20 );
kasarian.setForeground(Color.BLACK);
regreg.add (kasarian);
//--------------------------------------------------------------------
//Month
birth= new JComboBox();
birth.addItem("N/A");
birth.addItem("January");
birth.addItem("Febuary");
birth.addItem("March");
birth.addItem("April");
birth.addItem("May");
birth.addItem("June");
birth.addItem("July");
birth.addItem("August");
birth.addItem("September");
birth.addItem("October");
birth.addItem("November");
birth.addItem("December");
birth.setBounds(65,225,150,20);
regreg.add(birth);
bday = new JLabel ("Month");
bday.setFont(new Font("Candara", Font.BOLD, 15));
bday.setBounds( 10, 225, 200, 20 );
bday.setForeground(Color.BLACK);
regreg.add (bday);
month = new JLabel ("--------------Birthday--------------");
month.setFont(new Font("Candara", Font.BOLD, 15));
month.setBounds( 80, 195, 200, 20 );
month.setForeground(Color.BLACK);
regreg.add (month);
///++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//Day
JLabel araw;
JComboBox day= new JComboBox();
day.addItem("N/A");
day.addItem("1");
day.addItem("2");
day.addItem("3");
day.addItem("4");
day.addItem("5");
day.addItem("6");
day.addItem("7");
day.addItem("8");
day.addItem("9");
day.addItem("10");
day.addItem("11");
day.addItem("12");
day.addItem("13");
day.addItem("14");
day.addItem("15");
day.addItem("16");
day.addItem("17");
day.addItem("18");
day.addItem("19");
day.addItem("20");
day.addItem("21");
day.addItem("22");
day.addItem("23");
day.addItem("24");
day.addItem("25");
day.addItem("26");
day.addItem("27");
day.addItem("28");
day.addItem("29");
day.addItem("30");
day.addItem("31");
day.setBounds(65,250,150,20);
regreg.add(day);
araw = new JLabel ("Day");
araw.setFont(new Font("Candara", Font.BOLD, 15));
araw.setBounds( 10, 250, 200, 20 );
araw.setForeground(Color.BLACK);
regreg.add (araw);
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
JLabel taon;
year= new JComboBox();
year.addItem("N/A");
year.addItem("2014");
year.addItem("2013");
year.addItem("2012");
year.addItem("2011");
year.addItem("2010");
year.addItem("2009");
year.addItem("2008");
year.addItem("2007");
year.addItem("2006");
year.addItem("2005");
year.addItem("2004");
year.addItem("2003");
year.addItem("2002");
year.addItem("2001");
year.addItem("1999");
year.addItem("1998");
year.addItem("1997");
year.addItem("1996");
year.addItem("1995");
year.addItem("1994");
year.addItem("1993");
year.addItem("1992");
year.addItem("1991");
year.addItem("1990");
year.addItem("1989");
year.addItem("1988");
year.addItem("1987");
year.addItem("1986");
year.addItem("1985");
year.addItem("1984");
year.addItem("1983");
year.addItem("1982");
year.addItem("1981");
year.addItem("1980");
year.addItem("1979");
year.addItem("1978");
year.addItem("1977");
year.addItem("1976");
year.addItem("1975");
year.addItem("1974");
year.addItem("1973");
year.addItem("1972");
year.addItem("1971");
year.addItem("1970");
year.addItem("1969");
year.addItem("1968");
year.addItem("1967");
year.addItem("1966");
year.addItem("1965");
year.addItem("1964");
year.addItem("1963");
year.addItem("1962");
year.addItem("1961");
year.addItem("1960");
year.addItem("1959");
year.addItem("1958");
year.addItem("1957");
year.addItem("1956");
year.addItem("1955");
year.addItem("1954");
year.addItem("1953");
year.addItem("1952");
year.addItem("1951");
year.addItem("1950");
year.addItem("1949");
year.addItem("1948");
year.addItem("1947");
year.addItem("1946");
year.addItem("1945");
year.addItem("1944");
year.addItem("1943");
year.addItem("1942");
year.addItem("1941");
year.addItem("1940");
year.addItem("1939");
year.addItem("1938");
year.addItem("1937");
year.addItem("1936");
year.addItem("1935");
year.addItem("1934");
year.addItem("1933");
year.addItem("1932");
year.addItem("1931");
year.addItem("1930");
year.setBounds(65,275,150,20);
TAON tt = new TAON();
year.addActionListener(tt);
regreg.add(year);
taon = new JLabel ("Year");
taon.setFont(new Font("Candara", Font.BOLD, 15));
taon.setBounds( 10, 275, 200, 20 );
taon.setForeground(Color.BLACK);
regreg.add (taon);
//------------------------------------------------------------------------
JTextField add1;
JLabel add2;
add2 = new JLabel ("Address");
add2.setFont(new Font("Candara", Font.BOLD, 15));
add2.setBounds( 10, 310, 200, 20 );
add2.setForeground(Color.BLACK);
regreg.add (add2);
add1 = new JTextField ();
add1.setBounds(80,310,220, 20 );
regreg.add (add1);
//------------------------------------------------------------------------
JTextField limit;
JLabel creditdetails;
creditdetails = new JLabel ("----Account Information----");
creditdetails.setFont(new Font("Candara", Font.BOLD, 15));
creditdetails.setBounds( 82, 335, 200, 20 );
creditdetails.setForeground(Color.BLACK);
regreg.add (creditdetails);
//------------------------------------------------------------------------
//Account Number
accnt = new JLabel ("AccountNum");
accnt.setFont(new Font("Candara", Font.BOLD, 15));
accnt.setBounds( 10, 360, 200, 20 );
accnt.setForeground(Color.BLACK);
regreg.add (accnt);
laman = new JTextField (bishop);
laman.setBounds(105,360,195, 20 );
regreg.add (laman);
//------------------------------------------------------------------------
//Username Registration
userRegister = new JLabel ("Username");
userRegister.setFont(new Font("Candara", Font.BOLD, 15));
userRegister.setBounds( 10, 390, 200, 20 );
userRegister.setForeground(Color.BLACK);
regreg.add (userRegister);
userTxtReg = new JTextField ();
userTxtReg.setBounds(105,390,195, 20 );
regreg.add (userTxtReg);
//-----------------------------------------------------------------------
//Password
passRegistration = new JLabel ("Password");
passRegistration.setFont(new Font("Candara", Font.BOLD, 15));
passRegistration.setBounds( 10, 420, 200, 20 );
passRegistration.setForeground(Color.BLACK);
regreg.add (passRegistration);
passTxtRegistration = new JPasswordField ();
passTxtRegistration.setBounds(105,420,195, 20 );
regreg.add (passTxtRegistration);
//------------------------------------------------------------------
regButton = new JButton("Register");
regButton.setBackground(Color.green);
regButton.setFont(new Font("Candara", Font.BOLD, 15));
regButton.setBounds(10,465,100, 20 );
REGISTERACT rc = new REGISTERACT();
regButton.addActionListener(rc);
regreg.add (regButton);
}
}
//=====================================================================================================
//Register Button
public class REGISTERACT implements ActionListener{
public void actionPerformed (ActionEvent ae){
if(passTxtRegistration.getText().trim().length() == 0 &&userTxtReg.getText().trim().length() == 0)
{
JOptionPane.showMessageDialog(null, "Please fill out the informations!", "Message", JOptionPane.ERROR_MESSAGE);
}
else{
JOptionPane.showMessageDialog(null,"Successfully Registered!");
rehistro.setVisible(false);
log.setVisible(true);
}
}
}
//=====================================================================================================
public class TAON implements ActionListener{
public void actionPerformed (ActionEvent ae){
bishop = (String)year.getSelectedItem();
laman.setText("000-00-00-"+bishop+"-");
}
}
//======================================================================================================
public class LOGIN implements ActionListener{
public void actionPerformed (ActionEvent ae){
String aa = user.getText();
String bb = pass.getText();
//-------------------------------------------------------------------------------------------
//Administrator
if(user.getText().equalsIgnoreCase("admin") && pass.getText().equalsIgnoreCase("admin"))
{
JOptionPane.showMessageDialog(null,"Welcome Administrator!");
log.setVisible(false);
lagging = new JFrame("Login");
loglog = new JPanel();
loglog.setLayout( null );
lagging.setSize(350,500);//Size ng Frame
lagging.setLocation(400,170);//kung saan mag popUp ung Frame
lagging.setVisible(true);//Para makita ung Frame
lagging.setResizable(false);//Para hindi maresize yung Frame
lagging.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//para maclose ung Frame
lagging.setContentPane(loglog);//Para mailagay ang panel sa Frame //nakalagay sa loob kung anu ung gagamiting Jpanel
//=============================================================================================
//Login//administrator
//=============================================================================================
}
//----------------------------------------------------------------------------------------
//=============================================================================================
else{
JOptionPane.showMessageDialog(null,"Invalid Username or Password");
}
}
}
//========================================================================================
//------------------------------------------------------------------
//Menu Button=======================================================
public class MENU implements ActionListener{
public void actionPerformed (ActionEvent ae){
rehistro.setVisible(false);
log.setVisible(true);
}
}
//==========================================================================
public class MENU2 implements ActionListener{
public void actionPerformed (ActionEvent ae){
kame.setVisible(false);
log.setVisible(true);
}
}
//-----------------------------------------------------------------
public static void main(String[]args){
BankingSystem bs = new BankingSystem();
}
}