JSpinner DollarNumberFormater and HexNumberFormatter



Spinner 1.0 released:

NumberEditors for JSPinner HexNumberEDitor and DollarNumberEditor.

Copyright (c) 2007 Canadian Mind Products.

Java application.
Download from http://mindprod.com/products1.html#SPINNER

===> Free <===
Full source included.
You may even include the source code, modified or unmodified
in commercial programs that you write and distribute.
May be used freely for any purpose but military.
For more details on this restriction, see
http://mindprod.com/roedy.html#NONMILITARY
If you include any Canadian Mind Products code in your own
applications,
your app too must be labeled non-military use only.
All Java jars and source code are included.

----

Prerequisites:

This program runs under any OS,
(e.g. Win2K/XP/Vista/OSX/Linux/Solaris/Vista64/AIX...) so long as you
have
<><> Java version 1.5 <><> or later installed.
See http://mindprod.com/jgloss/installingjava.html for details.

----

Installing:

Download source and compiled class files to run on your own machine as
an application.
First install a recent Java JDK or JVM.
See http://mindprod.com/jgloss/installingjava.html.
To install, extract the zip download with Winzip
(or similar unzip utility) into any directory you please,
often J:\ -- ticking off the "user folder names" option.

To run as an application,type:
java -jar J:\com\mindprod\spinner\spinner.jar parms

adjusting as necessary to account for where the jar file is.


----

Use:


Spinner consists of source for classes to add hex and
formatted dollar input/output for Java JSpinner to your own
Java programs.

Spinner offers two NumberFormatter classes you can use with
a JSpinner. One is HexNumberFormatter which lets your
JSpinner range over hex values. The other is
DollarNumberFormatter which lets your JSpinner range over
dollar values. It works better than JSpinner.NumberEditor
with a DecimalFormat String since DollarNumberFormatter
displays the $ without requiring it on input. Further,
DollarNumberFormatter automatically rounds all values to the
nearest penny.

The program does nothing on its own other that demonstrate
the use of the two classes. The classes are designed to be
used in your own programs.

Why the double arrow icon? That's what the up/down control
on a Java JSpinner looks like.


--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
.