beep sound and with timer!

alpe gulay 0 Tallied Votes 982 Views Share

..this is a simple java code w/c allows to produce a beep sound.
timer also is being applied here.
hope it will help for any reason it may serve.
:-)

import java.awt.*;
import java.io.*;

public class timer_beep {

    public static void main(String args[])throws IOException
    {
            try{
                
                System.out.println("Countdown started!");
                    Thread.sleep(1000);
                for(int x=10;x>=0;x--)
                {
                        System.out.println(x);
                        Toolkit.getDefaultToolkit().beep();
                        Thread.sleep(600);
                }
                    Thread.sleep(2000);
                Toolkit.getDefaultToolkit().beep();
                    System.out.println("beep testing!");
               
            
            
        }
        catch(InterruptedException e) { }
             
    }
    
    
}
toyi 0 Newbie Poster

well done man , this is cool . keep it up.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.