Hi group,
Is there any way to tell a Java application _not_ to emit a beep
whenever an exception occurs?
I'm working on a program (mostly finished, but not completely) that has
already been put to limited use, and there's the aforementioned problem
- it *does* still have a few bugs, some of which cause an exception to
occur, and these produce an annoying beep. For the convenience of the
beta-version users, is there some way to silence it apart from pulling
the speaker plug from the motherboard?

Signature
-Aki "Sus" Laukkanen
Chris Smith - 15 Feb 2005 14:59 GMT
Aki "Sus" Laukkanen <aki.laukkanenREMOVETHIS@helsinki.fi> wrote:
> Is there any way to tell a Java application _not_ to emit a beep
> whenever an exception occurs?
Your question would make sense, except that Java applications don't emit
a beep whenever an exception occurs.
It sounds like, somewhere in your application, you are catching
exceptions and calling Toolkit.getDefaultToolkit().beep(). Perhaps if
you search your code for the word "beep", you can find and remove the
offending code.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
Boudewijn Dijkstra - 18 Feb 2005 21:27 GMT
"Aki "Sus" Laukkanen" <aki.laukkanenREMOVETHIS@helsinki.fi> schreef in bericht
news:cusug0$iil$1@oravannahka.helsinki.fi...
> Hi group,
>
> Is there any way to tell a Java application _not_ to emit a beep whenever an
> exception occurs?
Override java.awt.Toolkit.beep()
Roland - 19 Feb 2005 09:46 GMT
> "Aki "Sus" Laukkanen" <aki.laukkanenREMOVETHIS@helsinki.fi> schreef in bericht
> news:cusug0$iil$1@oravannahka.helsinki.fi...
[quoted text clipped - 5 lines]
>
> Override java.awt.Toolkit.beep()
I can't say this is impossible, but it would be rather difficult, since
Java installs a platform dependent Toolkit instance. On Windows it
happens to be sun.awt.windows.WToolkit (System property 'awt.toolkit').
The implementation of the beep() method probably uses a native OS call
to generate the sound.

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
Rob Kenworthy - 16 Mar 2005 02:13 GMT
Sounds to me like you are using an IDE like JBuilder which, I believe,
makes a beep noise whenever an exception is thrown while running a program
through the IDE. Check out your IDE settings to prevent this. If there is
no setting, you might be able to suppress the noise by adjusting the
windows sounds associated with various actions (i.e. sounds and multimedia
in control panel). Good luck.
Rob
-----------------------------------------------------
Check out http://jsourcery.com for javadocs and source code.