Class NumberField

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.TextComponent
          extended by java.awt.TextField
              extended by NumberField
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class NumberField
extends java.awt.TextField

AWT-component for input and output of numeric values.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.TextField
java.awt.TextField.AccessibleAWTTextField
 
Nested classes/interfaces inherited from class java.awt.TextComponent
java.awt.TextComponent.AccessibleAWTTextComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.TextComponent
textListener
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
NumberField()
          constructor for a NumberField
 
Method Summary
 void clear()
          Clears the NumberField
 double getDouble()
          Gets a double-value from the NumberField.
 float getFloat()
          Gets a float-value from the NumberField.
 int getInt()
          Gets an int-value from the NumberField.
 long getLong()
          Gets a long-value from the NumberField.
 boolean isNumeric()
          Checks wether the NumberField contains a valid numeric value.
protected  void processKeyEvent(java.awt.event.KeyEvent e)
           
 void setDouble(double d)
          Sets a double-value into the NumberField.
 void setDouble(double d, int N)
          Sets a double-value with N digits into the NumberField.
 void setFloat(float f)
          Sets a float-value into the NumberField.
 void setFloat(float f, int N)
          Sets a float-value with N digits into the NumberField.
 void setInt(int i)
          Sets an int-value into the NumberField.
 void setLong(long l)
          Sets a long-value into the NumberField.
 
Methods inherited from class java.awt.TextField
addActionListener, addNotify, echoCharIsSet, getAccessibleContext, getActionListeners, getColumns, getEchoChar, getListeners, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, minimumSize, minimumSize, paramString, preferredSize, preferredSize, processActionEvent, processEvent, removeActionListener, setColumns, setEchoChar, setEchoCharacter, setText
 
Methods inherited from class java.awt.TextComponent
addTextListener, enableInputMethods, getBackground, getCaretPosition, getInputMethodRequests, getSelectedText, getSelectionEnd, getSelectionStart, getText, getTextListeners, isEditable, processTextEvent, removeNotify, removeTextListener, select, selectAll, setBackground, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NumberField

public NumberField()
constructor for a NumberField

Method Detail

getDouble

public double getDouble()
Gets a double-value from the NumberField.


getFloat

public float getFloat()
Gets a float-value from the NumberField.


getInt

public int getInt()
Gets an int-value from the NumberField.


getLong

public long getLong()
Gets a long-value from the NumberField.


isNumeric

public boolean isNumeric()
Checks wether the NumberField contains a valid numeric value.


setDouble

public void setDouble(double d)
Sets a double-value into the NumberField.


setDouble

public void setDouble(double d,
                      int N)
Sets a double-value with N digits into the NumberField.


setFloat

public void setFloat(float f)
Sets a float-value into the NumberField.


setFloat

public void setFloat(float f,
                     int N)
Sets a float-value with N digits into the NumberField.


setInt

public void setInt(int i)
Sets an int-value into the NumberField.


setLong

public void setLong(long l)
Sets a long-value into the NumberField.


clear

public void clear()
Clears the NumberField


processKeyEvent

protected void processKeyEvent(java.awt.event.KeyEvent e)
Overrides:
processKeyEvent in class java.awt.Component