JMeter
The JMeter
class was designed to display an integer or decimal with a user-defined
left and right accuracy. The class makes sure the display is read-only.
Facial modifications of the instantiated object can also be readily
accomplished through methods.
The JMeter class is derived from JTextField from the JDK 1.2.2 libraries.
Although an unmodified JTextField object could have been used to
accomplish the same effect, the need for reusability and encapsulation
lends naturally to the creation of a JMeter class.
Integer and decimal values can be displayed in the JMeter. The amount
of the digits to the left and right of the decimal can be specified
as well. The font, foreground color, and background color can all
be adjusted to fit the developer's application. The value displayed
in the JMeter even rounds if for any reason the accuracy given by
the user truncates the original number.
|