import java.awt.*; import java.applet.*; public class AccountManagement extends DomainLogic { // inherits from DomainLogic public AccountManagement(TextArea textArea1) { super(textArea1); } public void doChgAcct(String acct) { // change to a different account if (investor==null) textArea1.append("Must login first.\n"); else { int acctno = toInt(acct); account = null; // iterate through the list of this investor's accounts for (int i=0; i 0) { account = (Account)investor.accounts.elementAt(0); acctField.setText(account.ACCOUNT_NO+""); } else textArea1.append("No open accounts for: "+id+"\n"); firstField.setText(investor.FIRST); lastField.setText(investor.LAST); phoneField.setText(investor.PHONE); textArea1.append("Investor Login: "+id+"\n"); } } } public void doCash(String type, String amount) { // DEPOSIT or WITHDRAW cash if (chkLogin() ) if (amount.equals("")) textArea1.append("Empty Cash field.\n"); else { double dollars = toDouble(amount); if (type.equals("DEPOSIT")) account.CASH = account.CASH + dollars; else account.CASH = account.CASH - dollars; Stock cash = (Stock) Stock.stocks.get("CASH"); new Transaction(account,cash,type,dollars,1); textArea1.append(type+ " completed.\n"); } } } // class AccountManagement