Class Prompt.Text

java.lang.Object
com.codename1.cli.Prompt.Text
Enclosing class:
Prompt

public static final class Prompt.Text extends Object
A text question with options: a default, a validator, masking.
  • Constructor Details

    • Text

      public Text(String question)
      A text question.
  • Method Details

    • defaultValue

      public Prompt.Text defaultValue(String value)
      The answer an empty line gives, shown in the prompt.
    • validator

      public Prompt.Text validator(Prompt.Validator validator)
      Checks the answer before it is accepted.
    • mask

      public Prompt.Text mask(char maskChar)
      Hides the answer, echoing maskChar for each character, or nothing at all when it is 0.
    • placeholder

      public Prompt.Text placeholder(String text)
      Faint text shown while the answer is empty.
    • ask

      public String ask()
      Asks the question and answers what was typed.