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.


Constructor Index

 o DoubleField(double)
Creates a DoubleField containing the specified number.

Method Index

 o getNumber()
Returns the number in the DoubleField, or 0 if the data in the field do not represent a valid floating-point number.
 o getPrecision()
Returns the precision of the number displayed in the DoubleField.
 o isValid()
Returns true if the data in the DoubleField represent a floating-point number, or false otherwise.
 o setNumber(double)
Sets the number displayed in the DoubleField to the specified value.
 o setPrecision(int)
Sets the precision of the number displayed in the DoubleField to the specified value.

Constructors

 o DoubleField
 public DoubleField(double num)
Creates a DoubleField containing the specified number.

Methods

 o 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).
 o getPrecision
 public int getPrecision()
Returns the precision of the number displayed in the DoubleField.

 o setNumber
 public void setNumber(double num)
Sets the number displayed in the DoubleField to the specified value.

 o 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
 o 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