All Implemented Interfaces:
Toggleable, KeyEventListener

public class TextBox
extends ActiveItem
A field to be filled with text by the user
  • Constructor Details

    • TextBox

      public TextBox​(InputDialog parent, CursorPosition initCoord, java.lang.String label)
      Default constructor

      Creates a new textBox inside a window, using default properties

      Parameters:
      parent - the textBox container
      initCoord - the textBox initial position relative to its container
      label - the textBox label
    • TextBox

      public TextBox​(InputDialog parent, CursorPosition initCoord, int width, int height, java.lang.String label)
      Custom constructor

      Creates a custom sized textBox inside a window

      Parameters:
      parent - the textBox container
      initCoord - the textBox initial position relative to its container
      label - the textBox label
      width - the label width
      height - the label height
  • Method Details

    • show

      public void show()
      Draws the textBox on the screen, drawing its background, borders and label
      Overrides:
      show in class WindowItem
    • onSelect

      public void onSelect()
      Shows the textBox shadows, placing the cursor at its beginning and removing its previous input
      Specified by:
      onSelect in class ActiveItem
    • onRelease

      public void onRelease()
      Hides the textBox shadows, saving an eventual input
      Specified by:
      onRelease in class ActiveItem