All Packages Class Hierarchy This Package Previous Next Index
Class BreezyGUI.DoubleField
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.TextComponent
|
+----java.awt.TextField
|
+----BreezyGUI.DoubleField
- public class DoubleField
- extends TextField
A DoubleField is a component that allows the editing of a double (floating-point number),
and allows the user to avoid messy conversions to and from strings.
-
DoubleField(double)
- Creates a DoubleField containing the specified number.
-
getNumber()
- Returns the number in the DoubleField, or 0 if the data in the field do not
represent a valid floating-point number.
-
getPrecision()
- Returns the precision of the number displayed in the DoubleField.
-
isValid()
- Returns true if the data in the DoubleField represent a floating-point number,
or false otherwise.
-
setNumber(double)
- Sets the number displayed in the DoubleField to the specified value.
-
setPrecision(int)
- Sets the precision of the number displayed in the DoubleField to the specified value.
DoubleField
public DoubleField(double num)
- Creates a DoubleField containing the specified number.
setPrecision
public void setPrecision(int prec)
- Sets the precision of the number displayed in the DoubleField to the specified value.
- Parameters:
- prec - the number of figures of precision (>= 0 and <= 10).
getPrecision
public int getPrecision()
- Returns the precision of the number displayed in the DoubleField.
setNumber
public void setNumber(double num)
- Sets the number displayed in the DoubleField to the specified value.
isValid
public boolean isValid()
- Returns true if the data in the DoubleField represent a floating-point number,
or false otherwise.
- Overrides:
- isValid in class Component
getNumber
public double getNumber()
- Returns the number in the DoubleField, or 0 if the data in the field do not
represent a valid floating-point number.
All Packages Class Hierarchy This Package Previous Next Index