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

Constructor Index

 o DblTextField(double, int)
Creates the text field

Method Index

 o getValue()
Get the data value
 o keyPressed(KeyEvent)
Null implementation of this method from the KeyListener interface.
 o keyReleased(KeyEvent)
Null implementation of this method from the KeyListener interface.
 o keyTyped(KeyEvent)
Requisite method for the KeyListener interface.
 o textValueChanged(TextEvent)
Requisite method for the TextListener interface.

Constructors

 o 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

Methods

 o 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
 o keyPressed
 public void keyPressed(KeyEvent evt)
Null implementation of this method from the KeyListener interface.

See Also:
keyPressed
 o keyReleased
 public void keyReleased(KeyEvent evt)
Null implementation of this method from the KeyListener interface.

See Also:
keyReleased
 o textValueChanged
 public void textValueChanged(TextEvent evt)
Requisite method for the TextListener interface. The appropriate internal methods are called in response.

See Also:
textValueChanged
 o getValue
 public double getValue()
Get the data value

Returns:
the data value as a double

All Packages  Class Hierarchy  This Package  Previous  Next  Index