Package rma.swing.text
Class IntegerDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
rma.swing.text.IntegerDocument
- All Implemented Interfaces:
Serializable
,Document
a Integer only document for JTextFields, and other components that use
PlainDocument
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
-
Field Summary
FieldsFields inherited from class javax.swing.text.PlainDocument
lineLimitAttribute, tabSizeAttribute
Fields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
int
getLength
(int length) int
getMax()
int
getMin()
void
insertString
(int offs, String str, AttributeSet a) void
setAllowsNegativeNumbers
(boolean b) void
setLength
(int length) void
setMax
(int max) void
setMin
(int min) Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate
Methods inherited from class javax.swing.text.AbstractDocument
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
-
Field Details
-
_length
protected int _length
-
-
Constructor Details
-
IntegerDocument
public IntegerDocument() -
IntegerDocument
-
-
Method Details
-
setMin
public void setMin(int min) -
getMin
public int getMin() -
setMax
public void setMax(int max) -
getMax
public int getMax() -
setLength
public void setLength(int length) -
getLength
public int getLength(int length) -
setAllowsNegativeNumbers
public void setAllowsNegativeNumbers(boolean b) -
allowsNegativeNumber
public boolean allowsNegativeNumber() -
insertString
- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classPlainDocument
- Throws:
BadLocationException
-