Description: Model ( or data ) associated with an Integer Text Field.
The insertString() function is called whenever data is being entered into
the text field. This is where the text field is checked to make sure only
integer valid charachters are being added.

This is an extention of the Model View Controller (MVC) design pattern that
all Java Swing elements are built upon. For example, the Java class JTextField
contains a PlainDocument model that actually contains the text of the
JTextField. This class simply replaces the JTextField PlainDocument with
this document. Then as a user types in text into the textfield, this class
instance is consulted to see if they are valid characters the user is
typing.

You don't have to know the details on how this class works in order to
use it. To make text field that uses this document model simply extend
JTextField and overide the method createDefaultModel() by creating
an instance of you subclass of Plain Document.
protected Document createDefaultModel() {
return new IntegerPlainDocument();
}

Note: SWR: This class was implemented with java JDK 1.3. In the new
java JDK 1.4 there is a much simpler way to do this. Now you can
instantiate a Formatter ( Decimal, Date, etc. ) and simply pass the formatter
to a Standard JTextField. No subclasses to make.