Banking Management System-Java Project

banking_system
banking_system



We Feel Grateful That We Got This Project From Abdulaziz Salihu Aliero – PG Student, Lovely Professional University Punjab, India

Introduction

The bank management system is an application for maintaining a person’s account in a bank. The system provides the access to the customer to create an account, deposit/withdraw the cash from his account, also to view reports of all accounts present.This project is based on banking managment system and is created by using java language

Banking System In Java

Hardware Requirement

  • Minimum Windows 95 software
  • IBM-compatible 486 system
  • Hard Drive and Minimum of 8 MB memory
  • A CD-ROM drive
  • Mouse, keyboard and sound card, if required

Software Requirement:

  • Operating System
  • Java SDK or JRE 1.6 or higher
  • Java Servlet Container (Free Servlet Container available)
  • Supported Database and library that supports the database connection with Java.

Modules:

  • Module 1 :

    Creating New Account:

  • Module 2:

    Deposit Money

    Withdraw Money

  • Module 3:

    Check Balance

    Display Account Details

  • Module 4:

    Check Interest

    Check Promo

  • Module 5:

    Apply For Loan

Module 1 Coding

Creating new account:

import javax.swing.*;public class home extends javax.swing.JFrame

{

String name,acc_type;

int Acc_num,Acc_Balance;

JOptionPane JOptionPane1;

public home()

{

initComponents();

}

void create_account(String n,int acc_num,int b,String a_t)

{

name=n;

Acc_num=acc_num;

Acc_Balance=b;

acc_type=a_t;

}

void deposit(int acct, int deposit)

{

Acc_num = acct;

Acc_Balance = deposit;

}

int Accnum()

{

return Acc_num;

}

void display()

{

System.out.println(this.name);

}

@SuppressWarnings(“unchecked”)

// the following code is already in the NetBeans

private void initComponents() {

 

create = new javax.swing.JButton();

deposit = new javax.swing.JButton();

withdraw = new javax.swing.JButton();

check = new javax.swing.JButton();

display = new javax.swing.JButton();

Apply = new javax.swing.JButton();

open = new javax.swing.JButton();

jLabel1 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

create.setText(“Create Account”);

create.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

createActionPerformed(evt);

}

});

 

deposit.setText(“Deposit Money”);

deposit.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

depositActionPerformed(evt);

}

});

withdraw.setText(“Withdraw Money”);

withdraw.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

withdrawActionPerformed(evt);

}

});

check.setText(“Check Balance”);

check.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

checkActionPerformed(evt);

}

});

display.setText(“Display Account Details”);

display.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

displayActionPerformed(evt);

}

});

 

Apply.setText(“Apply for loan”);

Apply.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

ApplyActionPerformed(evt);

}

});

open.setText(“Open Fix Deposit Account”);

open.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

openActionPerformed(evt);

}

});

 

jLabel1.setIcon(new javax.swing.ImageIcon(“C:\\Users\\HP\\Desktop\\banklog(1).jpg”)); // NOI18N

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(44, 44, 44)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)

.addComponent(create, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(withdraw, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

.addGap(381, 381, 381)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(Apply)

.addComponent(check))

.addContainerGap(77, Short.MAX_VALUE))

.addGroup(layout.createSequentialGroup()

.addComponent(deposit)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(display)

.addGap(55, 55, 55))))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(267, 267, 267)

.addComponent(open))

.addGroup(layout.createSequentialGroup()

.addGap(259, 259, 259)

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE)))

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 131, javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(create, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(check))

.addGap(21, 21, 21)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(display)

.addComponent(deposit))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)

.addComponent(open)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 21, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(withdraw)

.addComponent(Apply))

.addGap(70, 70, 70))

);

pack();

}

private void depositActionPerformed(java.awt.event.ActionEvent evt) {

javax.swing.JTextField acctnum = new javax.swing.JTextField(15);

javax.swing.JTextField amount = new javax.swing.JTextField(15);

 

javax.swing.JPanel myPanel = new  javax.swing.JPanel();

myPanel.add(new JLabel(“Account Number”));

myPanel.add(acctnum);

myPanel.add(Box.createVerticalStrut(10));

myPanel.add(new JLabel(“Amount To Deposit”));

myPanel.add(amount);

int result = JOptionPane.showConfirmDialog(null, myPanel,

“Deposit Money”, JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {

int Acct = Integer.parseInt(acctnum.getText());

int   deposits = Integer.parseInt(amount.getText());

deposit(Acct,deposits);

}

else

JOptionPane1.showMessageDialog(this,”Kindly enter  Account Number and press OK”);

}

private void createActionPerformed(java.awt.event.ActionEvent evt) {

javax.swing.JTextField acctnam = new javax.swing.JTextField(15);

javax.swing.JComboBox type = new javax.swing.JComboBox();

type.addItem(“select”);

type.addItem(“savings”);

type.addItem(“current”);

 

javax.swing.JPanel myPanel = new  javax.swing.JPanel();

myPanel.add(new JLabel(“Account Name”));

myPanel.add(acctnam);

myPanel.add(Box.createVerticalStrut(10)); // a spacer

myPanel.add(new JLabel(“Account Type”));

myPanel.add(type);

int result = JOptionPane.showConfirmDialog(null, myPanel,

“Create Account”, JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {

String Acct = acctnam.getText();

String  deposit = type.getSelectedItem().toString();

int bal=0;

int acctnum =(int)((Math.random()*9000)+1000);

create_account(Acct,acctnum,bal,deposit);

JOptionPane1.showMessageDialog(this,”Account Created Succeffully \n Account Number : “+acctnum);

}

else

JOptionPane1.showMessageDialog(this,”Kindly enter  Account Number and press OK”);

 

}

 

private void displayActionPerformed(java.awt.event.ActionEvent evt) {

javax.swing.JTextField acctnum = new javax.swing.JTextField(15);

 

 

javax.swing.JPanel myPanel = new  javax.swing.JPanel();

myPanel.add(new JLabel(“Account Number”));

myPanel.add(acctnum);

myPanel.add(Box.createVerticalStrut(10)); // a spacer

 

int result = JOptionPane.showConfirmDialog(null, myPanel,

“Please Enter Account Number “, JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {

int Acct = Integer.parseInt(acctnum.getText());

if(Acct== Acc_num)

{

 

JOptionPane1.showMessageDialog(this,” Account Name: “+ name+”\n Account Number”+Acc_num+”\nAccount Type”+acc_type+”\nAccount  Balance =”+Acc_Balance );

}

else

JOptionPane1.showMessageDialog(this,”Account Number Not Valid”);

}

}

private void withdrawActionPerformed(java.awt.event.ActionEvent evt) {

 

javax.swing.JTextField acctnum = new javax.swing.JTextField(15);

javax.swing.JTextField amount = new javax.swing.JTextField(15);

 

javax.swing.JPanel myPanel = new  javax.swing.JPanel();

myPanel.add(new JLabel(“Account Number”));

myPanel.add(acctnum);

myPanel.add(Box.createVerticalStrut(10)); // a spacer

myPanel.add(new JLabel(“Amount To Withdraw”));

myPanel.add(amount);

 

int result = JOptionPane.showConfirmDialog(null, myPanel,

“Enter Acct and the Amount to withdraw”, JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {

int Acct = Integer.parseInt(acctnum.getText());

int   deposits = Integer.parseInt(amount.getText());

if(Acct== Acc_num)

{

if(deposits<Acc_Balance)

{

Acc_Balance = Acc_Balance – deposits;

JOptionPane1.showMessageDialog(this,””+ deposits+ ” Has been withdrawn \n Balance =”+Acc_Balance );

}

 

else

JOptionPane1.showMessageDialog(this,”Amount to be withdrwan must be less than Available \n Your Availabale is:”+Acc_Balance);

 

}

 

else

JOptionPane1.showMessageDialog(this,”Account Number Not Valid”);

 

}

 

else

JOptionPane1.showMessageDialog(this,”Kindly enter  Account Number and press OK”);

 

}

 

private void checkActionPerformed(java.awt.event.ActionEvent evt) {

javax.swing.JTextField acctnum = new javax.swing.JTextField(15);

javax.swing.JPanel myPanel = new  javax.swing.JPanel();

myPanel.add(new JLabel(“Account Number”));

myPanel.add(acctnum);

myPanel.add(Box.createVerticalStrut(10)); // a spacer

 

int result = JOptionPane.showConfirmDialog(null, myPanel,

“Please Enter Account Number “, JOptionPane.OK_CANCEL_OPTION);

if (result == JOptionPane.OK_OPTION) {

int Acct = Integer.parseInt(acctnum.getText());

 

if(Acct==this.Acc_num)

{

JOptionPane1.showMessageDialog(this,”Account Balance is:”+Acc_Balance);

}

 

else

JOptionPane1.showMessageDialog(this,”Kindly enter  Account Number and press OK”);

 

}

 

}

 

private void ApplyActionPerformed(java.awt.event.ActionEvent evt) {

 

loans l = new loans(Acc_num,Acc_Balance);

l.setVisible(true);

}

 

private void openActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

fixdepo d = new fixdepo();

d.setVisible(true);

}

public static void main(String args[]) {

try {

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

if (“Nimbus”.equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

}

}

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

}

 

/* Create and display the form */

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

home h = new home();

h.setVisible(true);

 

}

});

}

// Variables declaration – do not modify

private javax.swing.JButton Apply;

private javax.swing.JButton check;

private javax.swing.JButton create;

private javax.swing.JButton deposit;

private javax.swing.JButton display;

private javax.swing.JLabel jLabel1;

private javax.swing.JButton open;

private javax.swing.JButton withdraw;

// End of variables declaration

}

Output

Home:

banking_system
banking_system

Create Account:

create_account_banking_system
create_account_banking_system

Deposit:

Deposite_money_banking_system
Deposite_money_banking_system

Withdraw:

Enter_Account_And_The_Amount
Enter_Account_And_The_Amount

Check Balance:

Check_Balance_Banking_System
Check_Balance_Banking_System

Display Account Details:

Account_number
Account_number

Apply Loan:

public class loans extends javax.swing.JFrame {static int Acct_no;

static int Acct_Bal;

double interest,total,due;

public loans(int Acct, int Bal) {

initComponents();

Acct_no = Acct;

Acct_Bal = Bal;

 

}

@SuppressWarnings(“unchecked”)

// <editor-fold defaultstate=”collapsed” desc=”Generated Code”>

private void initComponents() {

 

jButton1 = new javax.swing.JButton();

acct = new javax.swing.JTextField();

amount = new javax.swing.JTextField();

type = new javax.swing.JComboBox();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jLabel3 = new javax.swing.JLabel();

 

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

setTitle(“Apply Loan”);

 

jButton1.setText(“Apply”);

jButton1.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

jButton1ActionPerformed(evt);

}

});

 

acct.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

acctActionPerformed(evt);

}

});

 

type.setModel(new javax.swing.DefaultComboBoxModel(new String[] { “Car”, “Education”, “House” }));

 

jLabel1.setText(“Account Number”);

 

jLabel2.setText(“Period”);

 

jLabel3.setText(“Loan Type”);

 

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(158, 158, 158)

.addComponent(jButton1)

.addContainerGap(183, Short.MAX_VALUE))

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addGap(51, 51, 51)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel1)

.addComponent(jLabel2)

.addComponent(jLabel3))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)

.addComponent(type, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addComponent(amount)

.addComponent(acct))

.addGap(99, 99, 99))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addGap(51, 51, 51)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addComponent(acct, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel1))

.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(amount, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel2))

.addGap(26, 26, 26)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(type, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel3))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 38, Short.MAX_VALUE)

.addComponent(jButton1)

.addGap(84, 84, 84))

);

 

pack();

}// </editor-fold>

 

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

int acc =  Integer.parseInt(acct.getText());

int amounts =Integer.parseInt(amount.getText()) ;

String types = type.getSelectedItem().toString();

 

if(acc==Acct_no)

{

if(Acct_Bal>1000)

 

{

 

if(types==”Car”)

{

interest = amounts * (10.5/100);

 

}

else if(types==”House”)

{

interest = amounts * (8.5/100);

}

 

else if(types==”Education”)

{

interest = amounts * (5.5/100);

}

total = interest+amounts;

int dur =(int) total/12;

 

JOptionPane1.showMessageDialog(this,”Your loan has been granted Amount to pay\n Amount: “+total+” within 1 year\n “+dur+”   Each Month”);

this.setVisible(false);

}

else

{

 

JOptionPane1.showMessageDialog(this,”You must have atleast Rs.1000 to Apply for loan\n “);

this.setVisible(false);

}

}

 

else

 

{

JOptionPane1.showMessageDialog(this,”Account Number Invalid\n Enter Valid Acct Num”);

}

}

 

private void acctActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

}

 

public static void main(String args[]) {

 

//<editor-fold defaultstate=”collapsed” desc=” Look and feel setting code (optional) “>

/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.

* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

*/

try {

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

if (“Nimbus”.equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

}

}

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(loans.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(loans.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(loans.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(loans.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

}

//</editor-fold>

 

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new loans(Acct_no, Acct_Bal).setVisible(true);

 

 

}

});

}

// Variables declaration – do not modify

private javax.swing.JTextField acct;

private javax.swing.JTextField amount;

private javax.swing.JButton jButton1;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JComboBox type;

// End of variables declaration

private javax.swing.JOptionPane JOptionPane1;

}

 

 

apply_loan
apply_loan

Fix Deposit Account:

 

public class fixdepo extends javax.swing.JFrame {

 

public fixdepo() {

initComponents();

}

 

@SuppressWarnings(“unchecked”)

// <editor-fold defaultstate=”collapsed” desc=”Generated Code”>

private void initComponents() {

 

acc_name = new javax.swing.JTextField();

money = new javax.swing.JTextField();

durations = new javax.swing.JComboBox();

jLabel1 = new javax.swing.JLabel();

jLabel2 = new javax.swing.JLabel();

jLabel3 = new javax.swing.JLabel();

create = new javax.swing.JButton();

jLabel4 = new javax.swing.JLabel();

period = new javax.swing.JComboBox();

 

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

 

acc_name.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

acc_nameActionPerformed(evt);

}

});

 

durations.setModel(new javax.swing.DefaultComboBoxModel(new String[] { “yearly”, “monthly”, “quaterly ” }));

 

jLabel1.setText(“Account Name”);

 

jLabel2.setText(“Money to deposit”);

 

jLabel3.setText(“Duration”);

 

create.setText(“Create”);

create.addActionListener(new java.awt.event.ActionListener() {

public void actionPerformed(java.awt.event.ActionEvent evt) {

createActionPerformed(evt);

}

});

 

jLabel4.setText(“Period”);

 

period.setModel(new javax.swing.DefaultComboBoxModel(new String[] { “1”, “2”, “3”, “4”, “5” }));

 

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());

getContentPane().setLayout(layout);

layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()

.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(jLabel1)

.addComponent(jLabel2)

.addComponent(jLabel3))

.addGap(60, 60, 60)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)

.addGroup(layout.createSequentialGroup()

.addComponent(acc_name, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(97, 97, 97))

.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()

.addComponent(money, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)

.addGap(97, 97, 97))))

.addGroup(layout.createSequentialGroup()

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(142, 142, 142)

.addComponent(create))

.addGroup(layout.createSequentialGroup()

.addContainerGap()

.addComponent(jLabel4)

.addGap(113, 113, 113)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addComponent(durations, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(period, javax.swing.GroupLayout.PREFERRED_SIZE, 55, javax.swing.GroupLayout.PREFERRED_SIZE))))

.addGap(0, 0, Short.MAX_VALUE))

);

layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)

.addGroup(layout.createSequentialGroup()

.addGap(63, 63, 63)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(acc_name, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel1))

.addGap(37, 37, 37)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(money, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)

.addComponent(jLabel2))

.addGap(18, 18, 18)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel4)

.addComponent(period, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addGap(27, 27, 27)

.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)

.addComponent(jLabel3)

.addComponent(durations, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 28, Short.MAX_VALUE)

.addComponent(create)

.addGap(24, 24, 24))

);

 

pack();

}// </editor-fold>

 

private void acc_nameActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

}

 

private void createActionPerformed(java.awt.event.ActionEvent evt) {

 

String acc_names =acc_name.getText();

int moneys=Integer.parseInt(money.getText());

String duration = durations.getSelectedItem().toString();

int per = Integer.parseInt(period.getSelectedItem().toString());

int aNumber =(int)((Math.random()*9000)+1000);

double pere=0;

if(per==1)

pere= 0.08;

if(per==2)

pere=0.10;

if(per==3)

pere=0.15;

if(per>3)

pere=0.20;

 

double interest=0;

switch(duration)

{

case “yearly”:

interest= moneys * ((double)Math.pow((1 + (pere / 1)),(1 * per)));

break;

case “monthly”:

interest= moneys * ((double)Math.pow((12 + (pere / 12)),(12 * per)));

break;

case “quately”:

interest= moneys * ((double)Math.pow((4 + (pere / 4)),(4 * per)));

break;

default:

System.out.println(“”);

 

}

JOptionPane1.showMessageDialog(this,”Your Fixed Deposit Account Number:”+aNumber+ “\nInitial Deposit:”+moneys+” Earned money After”+per+”year is “+interest);

 

// TODO add your handling code here:

}

 

 

public static void main(String args[]) {

/* Set the Nimbus look and feel */

//<editor-fold defaultstate=”collapsed” desc=” Look and feel setting code (optional) “>

/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.

* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html

*/

try {

for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {

if (“Nimbus”.equals(info.getName())) {

javax.swing.UIManager.setLookAndFeel(info.getClassName());

break;

}

}

} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(fixdepo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(fixdepo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(fixdepo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(fixdepo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);

}

//</editor-fold>

 

/* Create and display the form */

java.awt.EventQueue.invokeLater(new Runnable() {

public void run() {

new fixdepo().setVisible(true);

}

});

}

// Variables declaration – do not modify

private javax.swing.JTextField acc_name;

private javax.swing.JButton create;

private javax.swing.JComboBox durations;

private javax.swing.JLabel jLabel1;

private javax.swing.JLabel jLabel2;

private javax.swing.JLabel jLabel3;

private javax.swing.JLabel jLabel4;

private javax.swing.JTextField money;

private javax.swing.JComboBox period;

// End of variables declaration

private javax.swing.JOptionPane JOptionPane1;

}

Output

Fixed_Deposite_Banking_System
Fixed_Deposite_Banking_System




One Comment

  1. michael kors handbags said:

    My wife and i were absolutely happy Jordan managed to conclude his reports because of the precious recommendations he discovered out of your weblog. It’s not at all simplistic to simply be giving freely things that some other people might have been selling. So we consider we have got the website owner to appreciate for that. All the explanations you’ve made, the straightforward website navigation, the friendships you will assist to engender – it’s got most amazing, and it’s making our son in addition to our family consider that that article is enjoyable, which is rather vital. Thank you for all!

    January 3, 2018
    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

*

code