Core Java| JSP| Servlets| XML| EJB| JEE5| Web Services| J2ME| Glossary| Questions?

 

 

 

 

 

 

 

 

 

 

 

 

 

Search Tutorials

Latest Questions
Comments
 
Beep Java 
 

Lets learn how to create beep using java. We can create a beep sound to indicate a warning or error.

 

Features

Technology
  Tech. Home
  GPS
  OSI
  WiMAX
  VoIP
  WiFi
  HSDPA
  LBS
  Vehicle Tracking
  SCADA
  Tech. What is?
Jobs At RoseIndia.net!
 
Join For Newsletter

Powered by groups.yahoo.com
Visit Group! Post Questions!

Beep Java

                         

Lets learn how to create beep using java.

We can create a beep sound to indicate a warning or error by using java. However, it is often better to give a warning dialog box with a description about  the problem using GUI interface.

There are  two ways to produce the sound beep:
1.Using Toolkit class: We can create a beep using Toolkit class. For this we first need to import java.awt.Toolkit. This class provides beep() method to create beep sound. The following syntax is used to create beep using Toolkit class:
import java.awt.Toolkit;
Use this statment in your code:
Toolkit.getDefaultToolkit().beep().
This is not always a sufficient way to alert the user as there may not be speakers on the user's computer.
2.Using ASCII value: ASCII refer as American Standard Code for Information Interchange. We use ASCII value "\007" to produce bee
p. As we are using in our example.

Here is the code of the program :

import java.util.*;
public class Beep{

   
    public static void main(String[] args) {

        if(args[0].equals("1"))
      System.out.println("\007");
    if(args[0].equals("2"))
      System.out.println("\007\007");
    if(args[0].equals("3"))
      System.out.println("\007\007\007");
    if(args[0].equals("4"))
      System.out.println("\007\007\007\007");
    if(args[0].equals("5"))
      System.out.println("\007\007\007\007\007");
    if(args[0].equals("6"))
      System.out.println("\007\007\007\007\007\007");
    if(args[0].equals("7"))
      System.out.println("\007\007\007\007\007\007\007");
    if(args[0].equals("8"))
      System.out.println("\007\007\007\007\007\007\007\007");
    }

}

Download this example.

                         

» View all related tutorials
Related Tags: c class make method sed boolean value ole set oo frame if boo to ram bool argument e il not

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

1 comments so far (
post your own) View All Comments Latest 10 Comments:

We are fully satisfied with ur data.Can u guide us to know the code for checking username and password and enter to a form/panel. The database is MS-Access

Posted by veena on Thursday, 09.6.07 @ 19:34pm | #25300

Training Courses
Tell A Friend
Your Friend Name
Software Solutions
Least Viewed
Most Rated
Recently Viewed
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Indian Software Development Company | iPhone Development Company in India | Flex Development Company in India | Java Training Delhi | Java Training at Noida |

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.