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.
-
fAllowFloat
-
-
maxVal
-
-
minVal
-
-
NumberEntry(float, int, float, float)
- Constructs a default NumberEntry with specified float.
-
NumberEntry(int, int, int, int)
- Constructs a default NumberEntry with specified integer.
-
getFloat()
- Returns the float parsed from the text entered.
-
getInt()
- Returns the integer parsed from the text entered.
-
handleEvent(Event)
- Method comment
-
setFloat(float)
- Sets the value to show in the entry field.
-
setInt(int)
- Sets the value to show in the entry field.
minVal
protected float minVal
maxVal
protected float maxVal
fAllowFloat
protected boolean fAllowFloat
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
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
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
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
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
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
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