@Override public void keyPressed(KeyEvent e) { clearErrorMessage(); } });
@Override public void keyPressed(KeyEvent e) { clearErrorMessage(); } });
public void modifyText(ModifyEvent event) { clearErrorMessage(); }
public void focusLost(FocusEvent e) { valueChanged(); clearErrorMessage(); } });
@Override public void focusLost(FocusEvent e) { valueChanged(); clearErrorMessage(); } });
/** * Checks whether the text input field contains a valid value or not. * * @return <code>true</code> if the field value is valid, * and <code>false</code> if invalid */ protected boolean checkState() { boolean result = false; if (emptyStringAllowed) { result = true; } if (textField == null) { result = false; } String txt = textField.getText(); result = (txt.trim().length() > 0) || emptyStringAllowed; // call hook for subclasses result = result && doCheckState(); if (result) { clearErrorMessage(); } else { showErrorMessage(errorMessage); } return result; }
/** * Checks whether the text input field contains a valid value or not. * * @return <code>true</code> if the field value is valid, * and <code>false</code> if invalid */ protected boolean checkState() { boolean result = false; if (emptyStringAllowed) { result = true; } if (textField == null) { result = false; } else { String txt = textField.getText(); result = (txt.trim().length() > 0) || emptyStringAllowed; } // call hook for subclasses result = result && doCheckState(); if (result) { clearErrorMessage(); } else { showErrorMessage(errorMessage); } return result; }
/** * Checks whether the text input field contains a valid value or not. * * @return <code>true</code> if the field value is valid, * and <code>false</code> if invalid */ protected boolean checkState() { boolean result = false; if (emptyStringAllowed) { result = true; } if (textField == null) { result = false; } else { String txt = textField.getText(); result = (txt.trim().length() > 0) || emptyStringAllowed; } // call hook for subclasses result = result && doCheckState(); if (result) { clearErrorMessage(); } else { showErrorMessage(errorMessage); } return result; }