I am working on a fairly complex Java application using Swing.
On some occasions there are unwanted beeps without any user intervention. No crash, application keeps
Your problem is discussed on the Java Forum:
// Write a custom toolkit
public class MyToolkit extends sun.awt.windows.WToolkit
{
public void beep() {
}
}
// Set this property
System.setProperty("awt.toolkit", "MyPackage.MyToolkit");
NOTE:
The use of this workaround is discouraged. You should still try to find the root of the problem.
Edit: Removed a link, since the thread on Java Forum is now offline.
In Swing you need to override the LookAndFeel
as follows:
UIManager.setLookAndFeel(new NimbusLookAndFeel() {
@Override
public void provideErrorFeedback(Component component) {
// Your beep decision goes here
// You want error feedback
super.provideErrorFeedback(component);
}
});
Typically your beep decision would reference some kind of external configuration/preferences flag for your application.