jpiv2
Class VerifierUInt

java.lang.Object
  extended by javax.swing.InputVerifier
      extended by jpiv2.VerifierUInt

public class VerifierUInt
extends javax.swing.InputVerifier

Unsigned Integer Input Verifier. Can be registered on an input component to verify user input.


Constructor Summary
VerifierUInt()
          Creates a new instance of VerifierUInt.
 
Method Summary
 boolean shouldYieldFocus(javax.swing.JComponent input)
          Calls the verify method.
 boolean verify(javax.swing.JComponent input)
          Checks the validity of a String typed into a JTextField.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VerifierUInt

public VerifierUInt()
Creates a new instance of VerifierUInt.

Method Detail

verify

public boolean verify(javax.swing.JComponent input)
Checks the validity of a String typed into a JTextField.

Specified by:
verify in class javax.swing.InputVerifier
Parameters:
input - A JTextField
Returns:
true if the String of the JTextField matches the regular expression "^[0-9]+$".

shouldYieldFocus

public boolean shouldYieldFocus(javax.swing.JComponent input)
Calls the verify method.

Overrides:
shouldYieldFocus in class javax.swing.InputVerifier
Parameters:
input - The input that needs to be verified.
Returns:
true if input is valid.