public class TextFieldVerifier
extends javax.swing.InputVerifier
implements java.awt.event.ActionListener
TextFieldVerifier
attaches to a JTextField and verifies
that the string conforms to a certain format. The verifier uses a
TextFieldVerifierImp
object to determine correctness and to
detect changes in the field value.Constructor and Description |
---|
TextFieldVerifier(javax.swing.JTextField field,
TextFieldVerifierImp imp)
Creates a new verifier for the specified field and implementor.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event) |
boolean |
shouldYieldFocus(javax.swing.JComponent input) |
boolean |
verify(javax.swing.JComponent input) |
public TextFieldVerifier(javax.swing.JTextField field, TextFieldVerifierImp imp)
field
- the text field to monitor and verify.imp
- the verifier implementor to use.public boolean verify(javax.swing.JComponent input)
verify
in class javax.swing.InputVerifier
public boolean shouldYieldFocus(javax.swing.JComponent input)
shouldYieldFocus
in class javax.swing.InputVerifier
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener