code: public void caretUpdate(CaretEvent e) {
  		try {
  			int testValue = Integer.valueOf(textField.getText()).intValue();
  
  			if ((testValue >= min) && (testValue <= max)) {
  				textField.setForeground(darkGreen);
  				setValue(testValue, false, true);
  			} else {
  				textField.setForeground(Color.red);
  			}
  		} catch (Exception ex) {
  			if (ex instanceof NumberFormatException) {
  				textField.setForeground(Color.red);
  			}
  
  			// Ignore all other exceptions, e.g. illegal state exception
  		}
  
  		textField.repaint();
  	}
docs: After any user input, the value of the textfield is proofed. Depending on
  being an integer, the value is colored green or red.
  
  @param e
  the caret event