Pocket Bank System with GUI (Version 2.1.5) | Full working Software for bank | Source code of Bank Software in Java (Version 2.1.5)


Promotion

Pocket Bank System (Version 2.1.5)

Pocket Bank System (Version 2.1.5)




Source code:

//************************************************************
//Pocket Bank System (Version 2.1.5)
//Written in Java By Syed Ali Haider
//Student of The Hajvery University,Lahore, Pakistan.
//Don't remove these lines for legal use
//For more Please contact us.
//Very Soon more efficient and better Version launched
//************************************************************


// import starting
import java.awt.Component;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JOptionPane; // for dialog box
//import ending


public class pocket_bank_system // java is the name of class

{ //class starts from here
      
    static long balance=1000; // balance in account initially
    static long withdraw; // for withdraw
    static long transfer;// for transfer
    static long deposit;// for deposit
   
// for deposit the money   
  public static void deposit()
  { // starting of deposit function
         String str;

              str=JOptionPane.showInputDialog   ("Please enter amount to deposit.");
              deposit = Long.parseLong(str);
        
              if (deposit <0) // if the user enter less than zero
              {
                   Component frame = null;
                     JOptionPane.showMessageDialog(frame,"You are not allow to deposit negative amount.","Input Error",  JOptionPane.ERROR_MESSAGE);
              }
              else if (deposit == 0) // if the user enter 0 as a amount
              {
                    
                      Component frame = null;
                           JOptionPane.showMessageDialog(frame,"You are not allow to deposit Zero as amount.","Input Error",  JOptionPane.ERROR_MESSAGE);
              }
             
              else if (deposit >0) // if the input us right then the amount add to balance
              {
                     balance=balance + deposit; // logic of the method/ function
                      Component frame = null;
                           JOptionPane.showMessageDialog(frame,"Your new balance is: Rs." + balance ,"Deposit Successfully",  JOptionPane.INFORMATION_MESSAGE);
              }
              else
                     ; // noting for error handling only.
             
  }// closing of deposit function
 
   
    // for draw some amount
       public static void draw()
      
              { // starting of draw function
              String str;

              str=JOptionPane.showInputDialog   ("Please enter amount to draw.");
              withdraw = Long.parseLong(str);
             
     
       

                             if (withdraw > balance) // if user want to get amount more than deposit amount
                             
                             {
                            Component frame = null;
                                         JOptionPane.showMessageDialog(frame,"Insufficient funds, You have only Rs. "+balance+ ".","Input Error",  JOptionPane.ERROR_MESSAGE);
                                  
                             }
                              else if (withdraw == 0) // if user enter 0 as a amount
                              {
                                   Component frame = null;
                                                JOptionPane.showMessageDialog(frame,"You enter Zero as amount.","Input Error",  JOptionPane.ERROR_MESSAGE);
                              }
                                  
                             else if (withdraw < 0) // if the amount is less than zero or negative
                             {
                                   Component frame = null;
                                                JOptionPane.showMessageDialog(frame,"You can't enter negative value.","Input Error",  JOptionPane.ERROR_MESSAGE);
                             }
                                                   
                             else
                             {
                                    balance=balance-withdraw;// logic of the method/function
                                    Component frame = null;
                                                JOptionPane.showMessageDialog(frame,"Your new balacne is:Rs." + balance+ ".","Withdraw Successfully",  JOptionPane.INFORMATION_MESSAGE);
                                               
                      }
                         
       }// closing of function
      
       // for transfer amount
      
       public static void trans()
       {// starting of transfer function
             
              String str3;

              str3=JOptionPane.showInputDialog  ("Please enter the amount to transfer.");
              transfer = Long.parseLong(str3);
             

                                                 if (transfer > balance) // if the balance is more than deposit amount

                                                       {
                                                        Component frame = null;
                                                              JOptionPane.showMessageDialog(frame,"Insufficient funds, You have only Rs. "+ balance+ ".","Input Error",  JOptionPane.ERROR_MESSAGE);
                                                 }

                                           else if (transfer == 0) // if the amount is zero
                                        
                                                
                                                        {
                                                        Component frame = null;
                                                                     JOptionPane.showMessageDialog(frame,"You enter Zero as amount.","Input Error",  JOptionPane.ERROR_MESSAGE);
                                                     }

                                                 
                                          else if (transfer < 0) // if the amount is less than zero
                                              
                                                
                                                        {
                                                        Component frame = null;
                                                                     JOptionPane.showMessageDialog(frame,"You enter a negative amount.","Input Error",  JOptionPane.ERROR_MESSAGE);
                                                     }

                                                
                    
                                          else
                                          {
                                                 balance=balance-transfer;// logic of the method/function
                                                 String act;// for account number or ID of recipient
                                                
                                                

                                                act=JOptionPane.showInputDialog   ("Please enter the Recipient's Name or ID.");
                                        
                                                 
                                         
                                                
                                                        Component frame = null;
                                                              JOptionPane.showMessageDialog(frame,"Rs. "+ transfer +" sent to "+ act,"Transfer Successfully",  JOptionPane.INFORMATION_MESSAGE);
                                                              JOptionPane.showMessageDialog(frame,"Your new balance is: Rs. " + balance +".","New Balance",  JOptionPane.INFORMATION_MESSAGE);
                                                

                                         }
                                          
       }//closing of trans function
      
         static JFrame myFrame = null;
      
       // main function
       public static void main(String[] args)
       { // starting of main function
                    
             
        Component frame = null;
                     JOptionPane.showMessageDialog(frame,"          !..........Welcome..........!\n\nPocket Bank System (Version 2.1.5) ","Pocket Bank System",  JOptionPane.INFORMATION_MESSAGE);
                    
                      JOptionPane.showMessageDialog(frame,"Sir, You have Rs. " + balance + " in your account.","Current Balance",  JOptionPane.INFORMATION_MESSAGE);
                    
                    
                           int loop=1;// for loop
                          
                           while (loop<2) // an infinite loop
                           { // starting of while
                                  
                 
                         
                           int input=8; // for get input
                                        
                                       
                                                              String[] options = {"Cash Deposit", "Cash Withdrowal", "Balance Transfer", "Balance Inquiry", "Exit"};
                                                          
                                                      JOptionPane myPane = new JOptionPane();
                                                      
                                                      myPane.setMessageType(JOptionPane.INFORMATION_MESSAGE);
                                                      
                                                       
                                                      myPane.setMessage("Please select from the given menu.");
                                                      
                                                      myPane.setOptions(options);
                                                      myPane.setInitialValue("Exit");
                                                      JDialog myDialog = myPane.createDialog (myFrame, "Input Menu");
                                                      
                                                      
                                                      myDialog.setVisible(true);
                                                      
                                                      Object answer = myPane.getValue();
                                                                                               
                                                      // for full fill the option selected form user
                                                      
                                                      if (answer=="Cash Deposit")
                                                         
                                                     
                                                         input=1;
                                                     
                                                      else  if (answer=="Cash Withdrowal")
                                                                                                                 
                                                              input=2;
                                                    
                                                      else  if (answer=="Balance Transfer")
                                                   
                                                         input=3;                                                    
                                           
                                                      else  if (answer=="Balance Inquiry")
                                                                                                          
                                                     
                                                         input=4;
                                                     
                                                      else  if (answer=="Exit")
                                                     
                                                         break;
                                                        
                                                      else  if (answer== null)
                                                      
                                                         break;
                                                         
                                                                                                  
                              

                           if(input==1) // condition
                               {
                                    deposit();// call for deposit function
                               }
                                    
                           else if (input==2) //condition
                                     
                           {
                             draw(); // call for draw function
                           }
                              
                           else if (input ==3 ) //condition
                           {
                           
                                  trans();// call for trans. function
                           }
                              

                           else if (input==4) //condition for balance inquiry
                           {
                         
                              Component frame1 = null;
                                         JOptionPane.showMessageDialog(frame1,"Your current balance is: Rs. " + balance + ".","New Balance",  JOptionPane.INFORMATION_MESSAGE);
                           }
                              
                       
                           else
                                  ; // for error handling

                         
                               
                          
                           Component frame123 = null;
                            int n = JOptionPane.showConfirmDialog( frame123,  "Do you want to use it again ?",  "Whats next ?",   JOptionPane.YES_NO_OPTION);
                            
                             if (n!=0) // again or not
                             
                                    break; // if user select no then break the loop
                           
                               
                           }// ending of while loop (which ask user to continue)
                          
                  
                            Component frame12 = null;
                            int n = JOptionPane.showConfirmDialog( frame12,  "Do you want to know about developer?",  "About Me",   JOptionPane.YES_NO_OPTION);
                            
                             if (n == 0) // again or not
                                    
                             {
                                   JOptionPane.showMessageDialog( frame12,  "Syed Ali Haider\n\n.Student of BS(honor in CS) 2nd Semester (May-2015)\n.The Hajvery University, Lahore, Pakistan\n.WWW.key-to-programming.blogspot.com\n.ali_supersmart@Yahoo.com\n",  "About Me",   JOptionPane.INFORMATION_MESSAGE);
                             }
                             
             
             
                     Component frame3 = null;
                           JOptionPane.showMessageDialog(frame3,"Thank you for using Pocket Bank System (version 2.1.5). ","Thank you",  JOptionPane.INFORMATION_MESSAGE);
                    
                          
              } // main function end here

                                 

             
       }//class close here
//************************************************************
//Pocket Bank System (Version 2.1.5)
//Written in Java By Syed Ali Haider
//Student of The Hajvery University,Lahore, Pakistan.
//Don't remove these lines for legal use
//For more Please contact us.
//Very Soon more efficient and better Version launched
//************************************************************

Comments

  1. retail banking software
    SunTec’s Relationship-based Billing Management on Xelerate platform complements and significantly augments existing core banking capabilities and enables contextual pricing.

    ReplyDelete

Post a Comment

Popular posts from this blog

Umbrella activities in Software Engineering

Operating System | Best Definition of Opetating System