title: Creating an object instance with a button click
body: <p>I am currently creating a very simple bank account program: The user enters the accountholder name, account number and beginning balance, then presses a "Continue" button to work with that account by making deposits and withdrawals. I wrote a separate <code>BankAccount</code> class with the required data members and methods. I've put the code for the creation of the BankAccount object in the <code>Continue</code> button click event </p>
  
  <pre><code>BankAccount currentAccount = new BankAccount(acctName, acctNum, beginningBalance);
  </code></pre>
  
  <p>But that seems to make it local to that method only, and <code>currentAccount</code> is not recognized when I'm programming the click event for the "Record Transactions" (deposits and withdrawals) button. </p>
  
  <p>How and where should the creation of the BankAccount object be coded in order for it to be created when the "Continue" button is clicked and also recognized in the "Record Transactions" button click event? Please let me know if any clarification is needed, or if you need to see part or all of my code.</p>