Package jexer

Class TInputBox

  • All Implemented Interfaces:
    java.lang.Comparable<TWidget>

    public class TInputBox
    extends TMessageBox
    TInputBox is a system-modal dialog with an OK button and a text input field. Call it like:
     
         box = inputBox(title, caption);
         if (box.getText().equals("yes")) {
             ... the user entered "yes", do stuff ...
         }
     
     
    • Constructor Detail

      • TInputBox

        public TInputBox​(TApplication application,
                         java.lang.String title,
                         java.lang.String caption)
        Public constructor. The input box will be centered on screen.
        Parameters:
        application - TApplication that manages this window
        title - window title, will be centered along the top border
        caption - message to display. Use embedded newlines to get a multi-line box.
      • TInputBox

        public TInputBox​(TApplication application,
                         java.lang.String title,
                         java.lang.String caption,
                         java.lang.String text)
        Public constructor. The input box will be centered on screen.
        Parameters:
        application - TApplication that manages this window
        title - window title, will be centered along the top border
        caption - message to display. Use embedded newlines to get a multi-line box.
        text - initial text to seed the field with
      • TInputBox

        public TInputBox​(TApplication application,
                         java.lang.String title,
                         java.lang.String caption,
                         java.lang.String text,
                         TMessageBox.Type type)
        Public constructor. The input box will be centered on screen.
        Parameters:
        application - TApplication that manages this window
        title - window title, will be centered along the top border
        caption - message to display. Use embedded newlines to get a multi-line box.
        text - initial text to seed the field with
        type - one of the Type constants. Default is Type.OK.
    • Method Detail

      • getText

        public java.lang.String getText()
        Retrieve the answer text.
        Returns:
        the answer text