@Override
    public boolean verify(JComponent input) {
        JTextField textField = (JTextField) input;
        String text = textField.getText();

        if (text.equals(lastGood)) {
            valueChanged = false;
            return true;
        }
        try {
            int parseInt = Integer.parseInt(text);
            if (parseInt >= lowerBound && parseInt <= upperBound) {
                lastGood = String.valueOf(parseInt);
                valueChanged = true;
                return true;
            }
            textField.setText(lastGood);
            valueChanged = false;
            return false;
        } catch (NumberFormatException e) {
            textField.setText(lastGood);
            valueChanged = false;
            return false;
        }
    }