Class ComputeButton

java.lang.Object
java.awt.Component
java.awt.Button
edu.hws.jcm.awt.ComputeButton
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class ComputeButton extends Button
A compute button is a button that can have an associated Controller. When the user clicks the button, the compute() method of the Controller is called. This class really just exists for convenience.
See Also:
  • Constructor Details

    • ComputeButton

      public ComputeButton()
      Create a Compute button labeled "Compute!".
    • ComputeButton

      public ComputeButton(String label)
      Create a Compute button displaying the given text.
  • Method Details

    • setOnUserAction

      public void setOnUserAction(Controller c)
      Set the controller whose compute() method is called when the user clicks this button.
    • getOnUserAction

      public Controller getOnUserAction()
      Return the controlller whose compute() method is called when the user clicks this button.
    • processActionEvent

      public void processActionEvent(ActionEvent evt)
      This is called by the system when the user clicks the button. Not meant to be called directly.
      Overrides:
      processActionEvent in class Button