org.jtheque.utils.ui
Class DocumentLengthFilterAvert
java.lang.Object
javax.swing.text.DocumentFilter
org.jtheque.utils.ui.DocumentLengthFilter
org.jtheque.utils.ui.DocumentLengthFilterAvert
public final class DocumentLengthFilterAvert
- extends DocumentLengthFilter
A document filter used to limit the length of a field. This filter avert the user with a popup when he go to
the limit.
- Author:
- Baptiste Wicht
Constructor Summary |
DocumentLengthFilterAvert(int max,
JTextField field)
Construct a new DocumentLengthFilterAvert associated with a specific field and with a
maximum number of characters. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DocumentLengthFilterAvert
public DocumentLengthFilterAvert(int max,
JTextField field)
- Construct a new
DocumentLengthFilterAvert
associated with a specific field and with a
maximum number of characters.
- Parameters:
max
- The maximum numbers of characters.field
- The field we want to associate to fhe filter.
remove
public void remove(DocumentFilter.FilterBypass fb,
int offset,
int length)
throws BadLocationException
- Overrides:
remove
in class DocumentFilter
- Throws:
BadLocationException
replace
public void replace(DocumentFilter.FilterBypass fb,
int offset,
int length,
String str,
AttributeSet attrs)
throws BadLocationException
- Overrides:
replace
in class DocumentLengthFilter
- Throws:
BadLocationException
Copyright © 2010 JTheque. All Rights Reserved.