Share this page 

Stop the beep on JFormattedTextFieldTag(s): Swing


When the user inputs an invalid value into JFormattedTextField, the default behavior is to emit a beep. To avoid this annoying beep, simply overload the invalidEdit() method.
class MyJFormattedTextField extends JFormattedTextField {
...
protected void invalidEdit() {}
...
}