Package jexer
Class TInputBox
- java.lang.Object
-
- jexer.TWidget
-
- jexer.TWindow
-
- jexer.TMessageBox
-
- jexer.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 ... }
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jexer.TMessageBox
TMessageBox.Result, TMessageBox.Type
-
-
Field Summary
-
Fields inherited from class jexer.TMessageBox
result
-
Fields inherited from class jexer.TWindow
ABSOLUTEXY, CENTERED, helpTopic, HIDEONCLOSE, inKeyboardResize, inWindowMove, inWindowResize, MODAL, mouse, NOCLOSEBOX, NOZOOMBOX, overlay, OVERRIDEMENU, RESIZABLE, statusBar, underlay
-
-
Constructor Summary
Constructors Constructor Description TInputBox(TApplication application, java.lang.String title, java.lang.String caption)
Public constructor.TInputBox(TApplication application, java.lang.String title, java.lang.String caption, java.lang.String text)
Public constructor.TInputBox(TApplication application, java.lang.String title, java.lang.String caption, java.lang.String text, TMessageBox.Type type)
Public constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getText()
Retrieve the answer text.-
Methods inherited from class jexer.TMessageBox
getResult, isCancel, isNo, isOk, isYes, onKeypress
-
Methods inherited from class jexer.TWindow
activate, addOverlay, addShortcutKeypress, addUnderlay, center, clearShortcutKeypresses, close, draw, ensureOnScreen, getApplication, getBackground, getBorder, getBorderControls, getHelpTopic, getMaximumWindowHeight, getMaximumWindowWidth, getMinimumWindowHeight, getMinimumWindowWidth, getScreen, getStatusBar, getTitle, getZ, hasCloseBox, hasHiddenMouse, hasOverriddenMenu, hasZoomBox, hide, inMovements, isHidden, isModal, isResizable, isShortcutKeypress, isShown, maximize, mouseOnClose, mouseOnMaximize, mouseOnResize, newStatusBar, onClose, onCommand, onFocus, onHide, onMenu, onMouseDown, onMouseMotion, onMouseUp, onPreClose, onResize, onShow, onUnfocus, removeShortcutKeypress, restore, setCloseBox, setHiddenMouse, setMaximumWindowHeight, setMaximumWindowWidth, setMinimumWindowHeight, setMinimumWindowWidth, setResizable, setTackboardsDirty, setTitle, setZ, setZoomBox, show, stopMovements, toString
-
Methods inherited from class jexer.TWidget
activate, activate, activateAll, addButton, addCalendar, addCheckBox, addCheckBox, addComboBox, addDirectoryList, addDirectoryList, addDirectoryList, addDirectoryList, addEditor, addField, addField, addField, addField, addImage, addImage, addLabel, addLabel, addLabel, addLabel, addLabel, addLabel, addList, addList, addList, addList, addPanel, addPasswordField, addPasswordField, addPasswordField, addProgressBar, addRadioGroup, addRadioGroup, addSpinner, addSplitPane, addTable, addTable, addText, addText, addTreeViewWidget, addTreeViewWidget, compareTo, doRepaint, drawBox, drawBox, drawBoxShadow, drawChildren, fileOpenBox, fileOpenBox, fileOpenBox, fileOpenBox, fileSaveBox, getAbsoluteX, getAbsoluteY, getActiveChild, getAttrXY, getChildren, getClipboard, getCursorAbsoluteX, getCursorAbsoluteY, getCursorX, getCursorY, getCustomMousePointer, getHeight, getLayoutManager, getMouseStyle, getParent, getTheme, getWidgetUnderMouse, getWidth, getWindow, getX, getY, handleEvent, hasChild, hLineXY, inputBox, inputBox, inputBox, isAbsoluteActive, isActive, isCursorVisible, isDrawable, isEchoKeystrokes, isEnabled, isPixelMouse, isVisible, messageBox, messageBox, mouseWouldHit, onIdle, onMouseDoubleClick, putAll, putAttrXY, putAttrXY, putCharXY, putCharXY, putCharXY, putStringXY, putStringXY, remove, remove, remove, remove, removeAll, resetTabOrder, setActive, setCursorVisible, setCursorX, setCursorY, setCustomMousePointer, setDimensions, setEchoKeystrokes, setEchoKeystrokes, setEnabled, setHeight, setLayoutManager, setMouseStyle, setParent, setupForTWindow, setVisible, setWidth, setWindow, setX, setY, splitHorizontal, splitVertical, switchWidget, toPrettyString, toPrettyString, vLineXY
-
-
-
-
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 windowtitle
- window title, will be centered along the top bordercaption
- 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 windowtitle
- window title, will be centered along the top bordercaption
- 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 windowtitle
- window title, will be centered along the top bordercaption
- message to display. Use embedded newlines to get a multi-line box.text
- initial text to seed the field withtype
- one of the Type constants. Default is Type.OK.
-
-