| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Dialog | +--CSLib.ClosableDialog | +--CSLib.InputBox
InputBox
is a closable dialog box that can receive and
translate textual keyword input into various Java types. It can read
and convert integers, doubles, strings, and characters.
The user must enter characters into a TextField, and then click on
the "Ok" button. If the characters are inappropriate for the
particular read
that has been requested (for example,
if a letter is entered during a call to readInt
),
then an ErrorBox
is raised.
End-of-input is indicated by the user entering nothing into the
TextField, and then clicking on the "Ok" button.
Fields inherited from class java.awt.Component |
TOP_ALIGNMENT, CENTER_ALIGNMENT, BOTTOM_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT |
Constructor Summary | |
InputBox() Constructs an InputBox with a default title. | |
InputBox(String title) Constructs an InputBox with a specific title. |
Method Summary | |
void | actionPerformed(ActionEvent e) Catches the clicking of the OK button (presumably after text has been entered in the textfield. |
boolean | eoi() Returns the end-of-input status |
char | readChar() Reads an Ascii character, and converts it to an char . |
double | readDouble() Reads an Ascii real number, and converts it to a double . |
int | readInt() Reads an Ascii integer, and converts it to an int . |
String | readString() Reads an Ascii string. |
void | setPrompt(String text) Sets the prompt to a particular string. |
Methods inherited from class java.awt.Dialog |
addNotify, isModal, setModal, getTitle, setTitle, show, hide, dispose, isResizable, setResizable, getAccessibleContext |
Methods inherited from class java.awt.Window |
pack, toFront, toBack, getToolkit, getWarningString, getLocale, getInputContext, setCursor, getOwner, getOwnedWindows, addWindowListener, removeWindowListener, getListeners, getFocusOwner, postEvent, isShowing, applyResourceBundle, applyResourceBundle, getGraphicsConfiguration |
Methods inherited from class java.awt.Container |
getComponentCount, countComponents, getComponent, getComponents, getInsets, insets, add, add, add, add, add, remove, remove, removeAll, getLayout, setLayout, doLayout, layout, invalidate, validate, setFont, getPreferredSize, preferredSize, getMinimumSize, minimumSize, getMaximumSize, getAlignmentX, getAlignmentY, paint, update, print, paintComponents, printComponents, addContainerListener, removeContainerListener, deliverEvent, getComponentAt, locate, getComponentAt, findComponentAt, findComponentAt, removeNotify, isAncestorOf, list, list |
Methods inherited from class java.awt.Component |
getName, setName, getParent, getPeer, setDropTarget, getDropTarget, getTreeLock, isValid, isDisplayable, isVisible, isEnabled, setEnabled, enable, enable, disable, isDoubleBuffered, enableInputMethods, setVisible, show, getForeground, setForeground, getBackground, setBackground, getFont, setLocale, getColorModel, getLocation, getLocationOnScreen, location, setLocation, move, setLocation, getSize, size, setSize, resize, setSize, resize, getBounds, bounds, setBounds, reshape, setBounds, getX, getY, getWidth, getHeight, getBounds, getSize, getLocation, isOpaque, isLightweight, getGraphics, getFontMetrics, getCursor, paintAll, repaint, repaint, repaint, repaint, printAll, imageUpdate, createImage, createImage, prepareImage, prepareImage, checkImage, checkImage, contains, inside, contains, dispatchEvent, addComponentListener, removeComponentListener, addFocusListener, removeFocusListener, addHierarchyListener, removeHierarchyListener, addHierarchyBoundsListener, removeHierarchyBoundsListener, addKeyListener, removeKeyListener, addMouseListener, removeMouseListener, addMouseMotionListener, removeMouseMotionListener, addInputMethodListener, removeInputMethodListener, getInputMethodRequests, handleEvent, mouseDown, mouseDrag, mouseUp, mouseMove, mouseEnter, mouseExit, keyDown, keyUp, action, gotFocus, lostFocus, isFocusTraversable, requestFocus, transferFocus, nextFocus, hasFocus, add, remove, toString, list, list, list, addPropertyChangeListener, removePropertyChangeListener, addPropertyChangeListener, removePropertyChangeListener, setComponentOrientation, getComponentOrientation |
Methods inherited from class java.lang.Object |
getClass, hashCode, equals, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public InputBox()
public InputBox(String title)
String
to use as the titleMethod Detail |
public void actionPerformed(ActionEvent e)
ActionEvent
that occurred.public boolean eoi()
true
if end-of-input is truepublic char readChar()
char
.
char
value read.public double readDouble()
double
.
double
value read.public int readInt()
int
.
int
value read.public String readString()
String
value read.public void setPrompt(String text)
String
to use for the new promptAssociation Links |
to Class java.awt.Label
to Class java.awt.Button
to Class java.awt.Font
| |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |