Home | Ajax | BioInformatics | Dojo | EAI | EJB | Hibernate | J2ME | Java | Java Glossary | Java Servlets | JavaScript | Jboss | JDBC | JDO | Jmeter | JSF | JSP | JUnit | Maven | MySQL | Spring Framework | SQL | Struts | Technology | WAP | Web Services | XML


 
  
 
Programming Tutorials: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML
 

 
Facing Programming Problem?
Ask Questions?, Browse Latest Questions, Question-Answer Guidelines
Java
  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification
  Java Applet
Questions
Comments

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.

                         

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

Latest Searches:
netbeans jsp
ensureCapacity of vect
tattoo efectes
compression of a file
rmi
standered jstl jar to
count the number of di
create xls using POI
Java Count words,reve
java.sql.Date
Quartz Tutorial
Date in JSP
Java show Vowels in th
code for Write a small
struts language swit
tibco
tabindex
setvisible tab
Socket tcp
Display name of system
what are the syntax in
Sentence case
set cell value JTable
jQuery To Hide the Div
conversion of decimal
seam tutorial
codebar
Retrieving Data From d
disable Jframe
apache derby embedded
richfaces a4j taglibr
constructor
selectOneRadio
java string
à¹?à¸?à¸?à¹???à¹?à¸?à¸
loading combo values f
bidirectional
space char
Java Pass Value
new language insert an
sql timestamp examples
/n java
download icefaces appl
checkbox button enable
calculate mode in Java
<logic:iterate>
extract title from htm
Display name of system
passing value from ser
A�������
Struts Dispatch Action
increase size of strut
qMgr.accessQueue(
tree and treenode (Aja
Tutorial:FlashBasicPas
AOP Example Spring
how to check the char
disabale Jframe
Photoshop Basics Add F
What are the defined J
convert date to number
array exmples
source code for displa
Display name
finding superscript in
create txt file in spe
text size
Easy UML Diagrams
flex datagrid
adding image in j2ee
program
Scrollbar for JList
Flash Dynamic Content
ะà¸??ะà¸?ย ะà
Servlet Context
Hibernate API
Hibernate with DAO
Insert Data into Datab
Combattons la programm
J2ee
Java String toLowerCase Example
Java String toCharArray Example
Java String substring Example
Java String indexOf Example
Java String startsWith Example
Java String hashCode Example
Java String matches Example
Java String length Example
Java String lastIndexOf Example
Java String isEmpty Example
Java String equalsIgnoreCase Example
Java String equals Example
Java String endsWith Example
Java String copyValueOf Example
Java String contentEquals Example
  EAI Articles
  Java Certification
Tell A Friend
Your Friend Name
Search Tutorials

 

 
 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

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 | 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.