Class WidgetPasswordBox

All Implemented Interfaces:
IDrawable, ISelectable, ITextInput

public class WidgetPasswordBox extends WidgetTextBox
WidgetPasswordBox represents a password input field in a user interface. It behaves like a text input field but does not display entered characters.
  • Constructor Details

    • WidgetPasswordBox

      public WidgetPasswordBox(int x, int y, int len, String text)
      Constructs a WidgetPasswordBox with default text alignment to the left.
      Parameters:
      x - The x-coordinate of the widget.
      y - The y-coordinate of the widget.
      len - The length of the widget.
      text - The initial text of the widget (usually empty for password fields).
    • WidgetPasswordBox

      public WidgetPasswordBox(int x, int y, int len, String text, TEXT_ALIGNMENT textAlignment)
      Constructs a WidgetPasswordBox with specified text alignment.
      Parameters:
      x - The x-coordinate of the widget.
      y - The y-coordinate of the widget.
      len - The length of the widget.
      text - The initial text of the widget (usually empty for password fields).
      textAlignment - The alignment of the text within the widget.
  • Method Details

    • draw

      public void draw(char[][] buffer, com.googlecode.lanterna.TextColor[][] printColor, com.googlecode.lanterna.TextColor[][] backColor)
      Overrides the draw method to not display the entered characters.
      Specified by:
      draw in interface IDrawable
      Overrides:
      draw in class WidgetTextBox
      Parameters:
      buffer - The buffer to draw the widget to.
      printColor - The color of the text.
      backColor - The color of the background.