com.vwp.swing.text
Class ExtendedDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.vwp.swing.text.ExtendedDocument
- All Implemented Interfaces:
- Serializable, Document
public class ExtendedDocument
- extends PlainDocument
This class implements a document object which can be used to limit the
maximum amount of characters a user can enter into a input field
- See Also:
- Serialized Form
| Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createPosition, dump, getAsynchronousLoadPriority, getBidiRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties |
ExtendedDocument
public ExtendedDocument(int numChars)
- Constructs a new ExtendedDocument object
- Parameters:
numChars - The maximum amount of characters after that all additional
input is ignored until the already stored number of characters is
decreased.
ExtendedDocument
public ExtendedDocument(Document document,
int numChars)
- Constructs a new ExtendedDocument object
- Parameters:
document - A Document object to use within this ExtendedDocumentnumChars - The maximum amount of characters after that all additional
input is ignored until the already stored number of characters is
decreased.
insertString
public void insertString(int offs,
String str,
AttributeSet a)
throws BadLocationException
- Specified by:
insertString in interface Document- Overrides:
insertString in class PlainDocument
- Throws:
BadLocationException