All Packages Class Hierarchy This Package Previous Next Index
Class dpscomponents.DblTextField
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.TextComponent
|
+----java.awt.TextField
|
+----dpscomponents.DblTextField
- public class DblTextField
- extends TextField
- implements TextListener, KeyListener
A text field that accepts integers or floating point numbers.
Its value is returned as a double.
This class is based on and very similar to the
IntTextField class appearing in Core Java by
Horstmann & Cornell (Sun Microsystems Press / Prentice-Hall, 1997).
The original author was Cay Horstmann (his version 1.1, 27 Mar 1997).
Their original copyright appears in this source code.
- Version:
- $Revision: 1.1.1.1 $, $Date: 1999/11/15 20:37:48 $.
- Author:
- Daren Stotler, Cay Horstmann
-
DblTextField(double, int)
- Creates the text field
-
getValue()
- Get the data value
-
keyPressed(KeyEvent)
- Null implementation of this method from the KeyListener interface.
-
keyReleased(KeyEvent)
- Null implementation of this method from the KeyListener interface.
-
keyTyped(KeyEvent)
- Requisite method for the KeyListener interface.
-
textValueChanged(TextEvent)
- Requisite method for the TextListener interface.
DblTextField
public DblTextField(double defval,
int size)
- Creates the text field
- Parameters:
- defval - an integer default,
- size - the number of columns in the text field
keyTyped
public void keyTyped(KeyEvent evt)
- Requisite method for the KeyListener interface. This version
registers only those characters anticipated for a floating point
number.
- See Also:
- keyTyped
keyPressed
public void keyPressed(KeyEvent evt)
- Null implementation of this method from the KeyListener interface.
- See Also:
- keyPressed
keyReleased
public void keyReleased(KeyEvent evt)
- Null implementation of this method from the KeyListener interface.
- See Also:
- keyReleased
textValueChanged
public void textValueChanged(TextEvent evt)
- Requisite method for the TextListener interface.
The appropriate internal methods are called in response.
- See Also:
- textValueChanged
getValue
public double getValue()
- Get the data value
- Returns:
- the data value as a double
All Packages Class Hierarchy This Package Previous Next Index