How do I play an alert sound in Java FX 2? Is there a way of using the OS default notification sound?
There is currently nothing in JavaFX itself to access the OS default alert sound (you can use JavaFX to trigger on events to play back fire and forget audioclips as well as tracked media audio like mp3s).
There is an open feature request: RT-21634 (anybody can signup to view the jira).
You can beep via awt:
Toolkit.getDefaultToolkit().beep();
Printing a beep character, nicely named 007 should work according to google searches, but does not on my machine - I guess it accesses a buzzer in the machine rather than the speaker system and my machine must not have the buzzer connected or enabled.
System.out.print("\007");
System.out.flush();