Class TextBox

  • All Implemented Interfaces:
    Resizable

    public class TextBox
    extends Box
    The `TextBox` class represents a box containing text that can be displayed on a screen. It extends the `Box` class and includes methods for setting and clearing text.
    • Field Detail

      • r

        protected int r
      • c

        protected int c
    • Constructor Detail

      • TextBox

        public TextBox​(int r,
                       int c)
        Constructs a `TextBox` with the specified position.
        Parameters:
        r - The row position of the TextBox.
        c - The column position of the TextBox.
    • Method Detail

      • setText

        public void setText​(String text)
        Sets the text content of the TextBox.
        Parameters:
        text - The text to be set in the TextBox.
      • setHeight

        public void setHeight​(int height)
        Sets the height of the TextBox.
        Specified by:
        setHeight in interface Resizable
        Overrides:
        setHeight in class Box
        Parameters:
        height - The height to be set for the TextBox.
      • clear

        public void clear()
        Clears the text content of the TextBox.
      • place

        public void place​(Screen sc)
        Places the TextBox on the specified screen.
        Overrides:
        place in class Box
        Parameters:
        sc - The Screen on which the TextBox is to be placed.