borland Packages Class Hierarchy dbswing Package
java.lang.Object +----javax.swing.text.AbstractDocument +----javax.swing.text.PlainDocument +----com.borland.dbswing.DBPlainDocument
Variables Constructors Properties Methods Event Listeners
Implements Serializable, Document
DBPlainDocument
is the default document (model) for text components that are attached to a DataSet
column of type STRING.
DBPlainDocument
has a maxLength
property that enforces a limitation on the number of characters that can be entered into a field. The default value of maxLength
is based upon the Column's
precision
property value. If precision
is -1, input is not limited by maxLength.
To set maxLength,
use code that looks like this:
((DBPlainDocument) jdbTextField1.getDocument()).setMaxLength(25);You might set
maxLength
for a column that is not provided by the query, or for a TableDataSet
. Don't set precision
for a Column
from a QueryDataSet
larger than the value from the server because you won't be
able to save those values back to the server. Also remember that if you set
precision
on a Column
from a server, the server's value takes precedence over yours unless you turn off metaDataUpdate
. It is for this reason that we suggest setting maxLength
instead.
To enforce additional input constraints at the model level (for example, to convert input characters to uppercase), extend DBPlainDocument
as necessary and set it as the text component's model.
public DBPlainDocument()Creates a
DBPlainDocument
by calling the constructor of its superclass.
public int getMaxLength() public void setMaxLength(int maxLength)Returns and sets the maximum number of characters that can be entered into a field.
public void addDocumentListener(javax.swing.event.DocumentListener ) public void removeDocumentListener(javax.swing.event.DocumentListener )
public void addUndoableEditListener(javax.swing.event.UndoableEditListener ) public void removeUndoableEditListener(javax.swing.event.UndoableEditListener )