Package app.ui.widgets
Class WidgetPasswordBox
java.lang.Object
app.ui.widgets.Widget
app.ui.widgets.WidgetTextBox
app.ui.widgets.WidgetPasswordBox
- All Implemented Interfaces:
IDrawable,ISelectable,ITextInput
WidgetPasswordBox represents a password input field in a user interface.
It behaves like a text input field but does not display entered characters.
-
Field Summary
-
Constructor Summary
ConstructorsConstructorDescriptionWidgetPasswordBox(int x, int y, int len, String text) Constructs a WidgetPasswordBox with default text alignment to the left.WidgetPasswordBox(int x, int y, int len, String text, TEXT_ALIGNMENT textAlignment) Constructs a WidgetPasswordBox with specified text alignment. -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(char[][] buffer, com.googlecode.lanterna.TextColor[][] printColor, com.googlecode.lanterna.TextColor[][] backColor) Overrides the draw method to not display the entered characters.Methods inherited from class app.ui.widgets.WidgetTextBox
drawSelection, keyStroke, select, unselectMethods inherited from class app.ui.widgets.Widget
drawText, getLen, getSelected, getSkipSelection, getText, getWidgetID, getX, getY, isHide, setHide, setSkipSelection, setText, setWidgetID
-
Constructor Details
-
WidgetPasswordBox
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
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:
drawin interfaceIDrawable- Overrides:
drawin classWidgetTextBox- Parameters:
buffer- The buffer to draw the widget to.printColor- The color of the text.backColor- The color of the background.
-