Module AM37

Class ReturningButton

All Implemented Interfaces:
Toggleable, KeyEventListener

public class ReturningButton
extends ClosingButton
A clickable button which returns a String value when clicked
  • Constructor Details

    • ReturningButton

      public ReturningButton​(InputDialog parent, CursorPosition initCoord, java.lang.String text, java.lang.String retVal)
      Default constructor

      Creates a new Button object, using its default properties

      Parameters:
      parent - the button container; must be an InputDialog (or subclass)
      initCoord - the initial coordinates, relative to the container
      text - the button text
      retVal - the value to return when clicked
    • ReturningButton

      public ReturningButton​(InputDialog parent, CursorPosition initCoord, int width, int height, java.lang.String text, java.lang.String retVal)
      Custom constructor

      Creates a new Button object, using custom dimensions

      Parameters:
      parent - the button container; must be an InputDialog (or subclass)
      initCoord - the initial coordinates, relative to the container
      width - the button width
      height - the button height
      text - the button text
      retVal - the value to return when clicked
  • Method Details

    • onSelect

      public void onSelect()
      Highlights the button, drawing its shadows
      Overrides:
      onSelect in class Button
    • onRelease

      public void onRelease()
      Releases the button, removing the shadow highlighting the selection
      Overrides:
      onRelease in class Button