Class dnx.awtutil.NumberEntry
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dnx.awtutil.NumberEntry

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.TextComponent
                   |
                   +----java.awt.TextField
                           |
                           +----dnx.awtutil.NumberEntry

public class NumberEntry
extends TextField
The NumberEntry class subclasses TextField to ensure numeric only entry. Copyright © 1996, Dimension X, Inc.

Variable Index

 o fAllowFloat
 o maxVal
 o minVal

Constructor Index

 o NumberEntry(float, int, float, float)
Constructs a default NumberEntry with specified float.
 o NumberEntry(int, int, int, int)
Constructs a default NumberEntry with specified integer.

Method Index

 o getFloat()
Returns the float parsed from the text entered.
 o getInt()
Returns the integer parsed from the text entered.
 o handleEvent(Event)
Method comment
 o setFloat(float)
Sets the value to show in the entry field.
 o setInt(int)
Sets the value to show in the entry field.

Variables

 o minVal
  protected float minVal
 o maxVal
  protected float maxVal
 o fAllowFloat
  protected boolean fAllowFloat

Constructors

 o NumberEntry
  public NumberEntry(int n,
                     int nCols,
                     int minVal,
                     int maxVal)
Constructs a default NumberEntry with specified integer. Note that this form sets the NumberEntry to disallow float chars.
Parameters:
n - the initial integer value.
nCols - the number of columns
 o NumberEntry
  public NumberEntry(float n,
                     int nCols,
                     float minVal,
                     float maxVal)
Constructs a default NumberEntry with specified float. Note that this form sets the NumberEntry to allow float chars.
Parameters:
n - the initial integer value.
nCols - the number of columns

Methods

 o getInt
  public int getInt() throws NumberFormatException
Returns the integer parsed from the text entered.
Throws: NumberFormatException
if try to get int and string has float chars
 o getFloat
  public float getFloat() throws NumberFormatException
Returns the float parsed from the text entered.
Throws: NumberFormatException
if try to get int and string has float chars
 o setInt
  public void setInt(int value)
Sets the value to show in the entry field. This is forced to the legal range as needed.
Parameters:
value - the value to show
 o setFloat
  public void setFloat(float value)
Sets the value to show in the entry field. This is forced to the legal range as needed.
Parameters:
value - the value to show
 o handleEvent
  public boolean handleEvent(Event evt)
Method comment
Returns:
simple text, and only if it is not the purpose of the method not like this one
Overrides:
handleEvent in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index