Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Bank Account System Java (GUI)

Options
  • 27-03-2013 11:19am
    #1
    Registered Users Posts: 295 ✭✭


    Hey guys

    I gotta develop a Bank Account System in Java that will:
    • add account,
    • de-activate account,
    • deposit money into an account
    • withdraw money from an account
    • retrieve account details
    • update account details
    • log of all actions to be stored in a file
    • And a GUI which allows all of this.
    Ive been at it for some time and cant get my head around it. Been trying to find examples online but nothing that can help me fully. Is there any good websites to watch tutorials or books that people would recommend as I only have 2weeks to get this done in between college and work.



    Cheers


Comments

  • Registered Users Posts: 8,191 ✭✭✭batistuta9


    some textboxes, few buttons = sorted

    this http://thenewboston.org/list.php?cat=31 covers GUI's, not sure now much/well though

    what are you actually looking for? how to create GUI's? something to copy/use inspiration from for design? etc.


  • Registered Users Posts: 2,021 ✭✭✭ChRoMe


    deco72 wrote: »
    Hey guys

    I gotta develop a Bank Account System in Java that will:
    • add account,
    • de-activate account,
    • deposit money into an account
    • withdraw money from an account
    • retrieve account details
    • update account details
    • log of all actions to be stored in a file
    • And a GUI which allows all of this.
    Ive been at it for some time and cant get my head around it. Been trying to find examples online but nothing that can help me fully. Is there any good websites to watch tutorials or books that people would recommend as I only have 2weeks to get this done in between college and work.



    Cheers

    How about actually reading your course notes?


  • Closed Accounts Posts: 899 ✭✭✭djk1000


    Not really sure from your post where the problem is? But forget the GUI for now, get your head around it with a console application

    Start with an account class, the account class has a few methods:

    deposit money into an account
    withdraw money from an account
    update account details

    So your account will have a balance property and maybe some details properties. The methods above will change the properties.

    You'll also have a method to retrieve account details.

    There will be a bank class too, but I'll let you figure that out :-)

    The bank needs to add an account (instantiate and account instance) and deactivate (not delete) an account (inactive/active boolean property), so two easy methods there.

    Once that's up and running you can worry about the GUI, then worry about logging.

    I assume you're starting out with programming, don't underestimate the usefulness of pseudo code/pencil/paper and breaking it down into small steps.

    If you're doing a college project, never worry about bells and whistles like logging (you could write to a text file, that's easy to do and meets the requirement) or the GUI until everything else is working, once the basics are right and the logic is good, you'll pass and that will take the pressure off when you want to build up the more complex features.

    If you're spending most of your time searching the internet for tutorials, you'll never learn what's important, which is understanding the logic and OO design. That will stay with you no matter what language you end up using next.

    Last bit of advice, once you have a bit of code working, then copy and paste it to Notepad++ as a backup before you start trying to add in the more advanced stuff.

    Hope that helps!


  • Registered Users Posts: 295 ✭✭deco72


    batistuta9 wrote: »
    some textboxes, few buttons = sorted

    this http://thenewboston.org/list.php?cat=31 covers GUI's, not sure now much/well though

    what are you actually looking for? how to create GUI's? something to copy/use inspiration from for design? etc.


    Cheers for that I was already using his tutorials to mess around with the GUI side of things. I think I am going to start fresh again like the post below says and make sure everything works in the normal console before adding the GUI.

    I have done small java programs before for a creche system which asked for user input for child and parent details using the scanner class. For this bank system I am in the middle of doing the same however I have to use the class Name for accountName and class Date for lastTransactionDate. Ive been trying to solve this problem but i cant seem to find how to accept these inputs using the scanner class.

    Is there anything I can use in the scanner class to accept these values? I am a beginner in Java and it is hard getting my head around it.

    I appreciate all the help.


  • Registered Users Posts: 295 ✭✭deco72


    djk1000 wrote: »
    Not really sure from your post where the problem is? But forget the GUI for now, get your head around it with a console application

    Start with an account class, the account class has a few methods:

    deposit money into an account
    withdraw money from an account
    update account details

    So your account will have a balance property and maybe some details properties. The methods above will change the properties.

    You'll also have a method to retrieve account details.

    There will be a bank class too, but I'll let you figure that out :-)

    The bank needs to add an account (instantiate and account instance) and deactivate (not delete) an account (inactive/active boolean property), so two easy methods there.

    Once that's up and running you can worry about the GUI, then worry about logging.

    I assume you're starting out with programming, don't underestimate the usefulness of pseudo code/pencil/paper and breaking it down into small steps.

    If you're doing a college project, never worry about bells and whistles like logging (you could write to a text file, that's easy to do and meets the requirement) or the GUI until everything else is working, once the basics are right and the logic is good, you'll pass and that will take the pressure off when you want to build up the more complex features.

    If you're spending most of your time searching the internet for tutorials, you'll never learn what's important, which is understanding the logic and OO design. That will stay with you no matter what language you end up using next.

    Last bit of advice, once you have a bit of code working, then copy and paste it to Notepad++ as a backup before you start trying to add in the more advanced stuff.

    Hope that helps!


    Hi

    Thanks for the help much appreciated. I have started fresh again and forgot about doing the GUI and have been trying to figure out the normal console. I have however come across a problem as any program I have done before used String/double/int etc but now we have to use Date and Name instead of String for the accountName and lastTransactionDate.

    My Code:

    public static void addAccount()
    {
    String accountId;
    Name accountName;
    double accountBalance;
    Date lastTransactionDate = null;
    Boolean accountActive;

    System.out.println("Please Enter New Account ID : ");
    accountId=sc.next();

    System.out.println("Please Enter New Account Name : ");
    accountName=fd;

    System.out.println("Please Enter Initial Account Balance : ");
    accountBalance=sc.nextDouble();

    System.out.println("Please Enter Date of Transaction : ");
    lastTransactionDate.parse(sc.nextLine());

    System.out.println("Set Account Status : ");


    Account account = new Account(accountId, accountName, accountBalance, lastTransactionDate, accountActive);

    if(bank.add(account))
    {
    currentSize++;
    }

    }

    ***I cant figure out what to use to accept the users input for Name and Date. ***

    I have then continued on to set up the menu and some other methods, however I cannot test them as of yet due to the above problem any help would be greatly appreciated.


  • Advertisement
  • Registered Users Posts: 8,191 ✭✭✭batistuta9


    You probably have written the Name & Date classes yourself, right?

    you know what fields/instance variables them classes have, so you could take the input for them in separately first using the scanner, then set the fields - instead of trying to take it in the one go

    also there's a bug with the Scanner class, which i'm not sure if fixed, but after taking in int's, maybe double's too, it doesn't clear the buffer properly & if you try to take a String input after them you'll get nothing

    So if you're doing that add Scanner.nextLine() before trying to read in a String after an int or create two Scanners - one for Strings the other for int's, double's


  • Registered Users Posts: 295 ✭✭deco72


    batistuta9 wrote: »
    You probably have written the Name & Date classes yourself, right?

    you know what fields/instance variables them classes have, so you could take the input for them in separately first using the scanner, then set the fields - instead of trying to take it in the one go

    also there's a bug with the Scanner class, which i'm not sure if fixed, but after taking in int's, maybe double's too, it doesn't clear the buffer properly & if you try to take a String input after them you'll get nothing

    So if you're doing that add Scanner.nextLine() before trying to read in a String after an int or create two Scanners - one for Strings the other for int's, double's

    Hi no the name and date are coming from the object class so this is the problem. If I was allowed use string for these it would be no problem. I think I will have to wait till back in college to sort that one but ill just figure out the rest of methods as if I am using strings for the variables so I know that at least I have them working.

    Yeah there is still a bug in the scanner class it is pretty annoying ha.

    Thanks for the help, as you can prob guess I am new to java this year and I do find it hard to get my head around. I prefer the systems analysis stuff.


  • Registered Users Posts: 8,191 ✭✭✭batistuta9


    deco72 wrote: »
    Hi no the name and date are coming from the object class so this is the problem. If I was allowed use string for these it would be no problem. I think I will have to wait till back in college to sort that one but ill just figure out the rest of methods as if I am using strings for the variables so I know that at least I have them working.

    what do you mean coming from the Object class?


Advertisement