Class IntegerVerifier

java.lang.Object
  extended byjavax.swing.InputVerifier
      extended byIntegerVerifier

public class IntegerVerifier
extends javax.swing.InputVerifier

Input Verifier to verifier integer text fields Checks for valid integer input, and to see if the number is between a specified max and min value.

Author:
Mark Pendergast

Constructor Summary
IntegerVerifier(VerifierListener alistener, boolean blankok, int min, int max)
          Creates a new instance of IntegerVerifier
 
Method Summary
 boolean verify(javax.swing.JComponent jComponent)
          Verifies contents of the specified component
 
Methods inherited from class javax.swing.InputVerifier
shouldYieldFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IntegerVerifier

public IntegerVerifier(VerifierListener alistener,
                       boolean blankok,
                       int min,
                       int max)
Creates a new instance of IntegerVerifier

Parameters:
alistener - VerifierListener to receive invalid/valid data class (null means no listener)
blankok - if true, then the field can be left blank
min - minimum valid value
max - maximum valid value
Method Detail

verify

public boolean verify(javax.swing.JComponent jComponent)
Verifies contents of the specified component

Parameters:
jComponent - the component to check
Returns:
true if the component is ok, else false