Here you can find the source of beepSound()
public static void beepSound()
//package com.java2s; //License from project: Open Source License import java.awt.Toolkit; public class Main { public static void beepSound() { Toolkit.getDefaultToolkit().beep(); }/*from w ww . j av a 2s.c o m*/ public static void beepSound(int times) { for (int i = 0; i < times; i++) { try { Thread.sleep(500); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } beepSound(); } } }