Class Controller

java.lang.Object
  extended by Controller
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class Controller
extends java.lang.Object
implements java.awt.event.ActionListener


Constructor Summary
Controller(View v, SimpleBankAccount s)
          Creates a controller with the given view and bank account model.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Handles events associated with the view.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Controller

public Controller(View v,
                  SimpleBankAccount s)
Creates a controller with the given view and bank account model.

Parameters:
v - View associated with the controller
s - Bank account model associated with the controller
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Handles events associated with the view. If the withdraw button is pressed in the view, this method takes the amount contained in the text field and withdraws it from the bank account. If the deposit button is pressed in the view, this method takes the amount contained in the text field and deposits it to the bank account. Either way, the balance is updated in the view.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - Event associated with this handler.