How to make beep by PC speaker in java

hello,everybody:
I know that can make pc speaker produce beep voice in c language through use ascII--007,but how to realize it in java application.Please help me,thank you.

Hi, try this
Toolkit.getDefaultToolkit().beep();this also works on some systems
System.out.print( '\u0007' );   
System.out.print( '\007' );   
System.out.print( (char)0x07 );hope this helps
AA

Similar Messages

  • How to make a jar file from a java file?

    how to make a jar file from a java file, is there any one tht can help me thank you;

    You can study this.
    http://java.sun.com/docs/books/tutorial/jar/basics/index.html

  • How to make a data base connexion in java?

    I have an oracle 7 data base that i want to connect how to make a data base connexion in java?

    J
    D
    B
    C
    Search these forums or follow the JDBC tutorial

  • How to make a simple Pc Speaker sound output?

    Hello,
    how can a make a simple PC Speaker sound output like the standard beep for errormessages?
    Can anybody help me?
    Thanks,
    Alex

    Use this:Toolkit.getDefaultToolkit().beep(); or this: System.out.print("\0007");
    System.out.flush();

  • How to make an exe file from a java class file

    i know one of the java's most powerfull properties is plataform independent, but if i have done one application (with GUI) that i want to run on Win32 for example, if anyone knows how to make it please send me a message to [email protected], how i know that can be make it? because HotJava is made in Java and in Win32 is a executable

    Do a search on these forums for any of the thousands of times this question has been asked and any of the thousands of times it's been answered.

  • How to make a "Program" out of my .java files?

    I have made a little application that stores a file to disk. Is there someway to make a file out of my .java files so it can be run without opening my editor and choosing run?

    sorry I didn't check that, I can now run the jar command.
    But even though I can create a .jar file I get an error. I have followed the guide that says I need to add the applications Entry point.
    I have two classes:
    saveDates.class //contains the main method
    UserInput.claa // Parsing of user input
    When I create the jar file I type:
    jar cfe saveDates.jar SaveDates SaveDates.class UserInput.class
    But when I try to run it like:
    java -jar saveDates.jar
    I get the error:
    C:\workspace\dato>java -jar saveDates.jar
    Exception in thread "main" java.lang.NoClassDefFoundError: SaveDates$1
    at SaveDates.main(SaveDates.java:89)
    C:\workspace\dato>
    Do I need to change the main method someway?

  • How to make the Micrphone and speaker work?

    Just installed the new version of Conexant Smart Audio driver version 4.92.7.0/3.64.7.0 Release 2009/08/06
    on Lenevo T400 Windows Vista 32. My microphone was able to record voice but i cannot hear my voice on the speaker. No other devices are installed in the Recording Tab of Sound property except Internal Microphone. 
    Hope some was able to make this work. 
    botnoe 

    Hello dcloko_BR,
    I downloaded and installed Lenovo´s The Lenovo Solution Center and now the solution center starts after pressing the blue button. Perhaps give it a try.
    Edit: Upps sorry, only newer models are supported according to the readme.txt.
    Best regards
    Andreas
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • How to make sure an applet runs with Java 5?

    Hi all,
    First let me say thanks for all the help in the past. You've help me go from noob to intermediate noob. I've just about finished my first applet game which can be checked out here .
    Now I've been reading about problems with mac and 1.6. (note it works on Linux). I want to make sure that it runs fine and of course I don't own a mac. So I downloaded the 5 JDK. Selected it as the java platform in Netbeans, compiled and it ran fine.
    Questions:
    Do I have to always use 1.5 to compile and perhaps set it as default?
    Since it works in 1.5, do I compile it with 1.6 and just upload?
    I'm worried I'm not testing it correctly. I mean if I have both 1.5 and 1.6 installed on my machine, how to I make sure the applet is only using 1.5 to run?
    Thanks
    Darrin

    corlettk wrote:
    I haven't got a clue RE your problem other than for max-portability you should compile with [-target 1.5|http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/javac.html].
    I must say I'm impressed, except I suspect my PC must be substantially faster than any of your test platforms... can you throttle it to CPU performance somehow? Or maybe it's just that my reflexes aren't what they once where.Thanks.
    There seem to be two issues. The first is what people are using. This web stats shows pretty poor penetration of 1.6.
    [http://www.statowl.com/java.php|http://www.statowl.com/java.php] Penetration: 54% with JRE1.6 + 19% with JRE 1.5. Total 73%.
    The second is I've read that mac and 1.6 do not get along except on a 64bit platform.
    So for applets there is not much choice but to compile on 1.5 for the broadest user base. I guess the good news is 1.4 and earlier are almost non-existent.
    Edited by: Darrin.A on Apr 27, 2009 8:11 AM

  • How To make/configure  Broadband connection in Sun java desktop system

    Hi all,
    I am using sun java desktop system Release 3 solaris 10 version in my sun ultra workstation. I have a problem with it. I can not make broadband connection , in it. so pls let me know how can i make broadband connection with my ADSL modem ?
    Thanks
    Partha

    Try this:
    Log into a termina as rootl. (Select failsafe terminal or command login)
    To get the name of your network interface driver, type:
    /usr/sbin/ifconfig -a You'll see something like this:
    lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    hme0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet 129.156.226.245 netmask ffffff00 broadcast 129.156.226.255
    In my case it is hme0 so I create a file called /etc/dhcp.hme0:
    touch /etc/dhcp.hme0If you want to set a hostname, put it in a file called /etc/hostname.hme0 for example:
    rm /etc/hostname.hme0
    echo myhostname > /etc/hostname.hme0Most broadband providers preconfigure ADSL modems to default to DHCP so if you do this, connect the ultra 10 to the broadband modem and reboot, the ultra 10 should pick up an IP address and be connected to the internet.

  • How to make a dynamic proxy client in Java ME?

    Hi guys!
    I have an existing static stub web service client to WCF made by generating client stub feature of the Netbeans. How do I make this into a dynamic proxy?

    tsubaki.pw wrote:
    I have an existing static stub web service client to WCF. How do I make this into a dynamic proxy?What is the WCF?

  • How to make a all new gui in java

    I am fed up of using metal motif and windows look and feel gui in java...........how can i make a more fancy gui.......
    the one like ym or gtalk.......

    See The Java&#8482; tutorials: [The Synth Look and Feel|http://java.sun.com/docs/books/tutorial/uiswing/lookandfeel/synth.html]
    db

  • How to make a shortcut to run my Java app in Windows?

    Hiya, Coders :-)
    I am an absolute beginner.
    I have copied a little window program from "Java 2 in easy steps".
    I run it from the command line and a little window pops up.
    I cannot find a way to start the app without the command prompt.
    How can I make a shortcut to start it?
    Julian (-_-)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hiya, Coders ;-)
    As it happens, I have a game from UJ Software: "Shisen for Java".
    It has a shortcut, of course.
    Here are all its details just in case it helps ...
    The game folder is here:
    C:\Program Files\UJ Software\Shisen for Java\jShisen.jar
    Contents of the installed shortcut ...
    General:
    Type of file: Shortcut
    Opens with: Java(TM) Platform SE binary
    Location: C:\Documents and Settings\Julian Bury\Start Menu\Games
    Shortcut:
    Target Type: Executable Jar File
    Target location: Shisen for Java
    Target: "C:\Program Files\UJ Software\Shisen for Java\jShisen.jar"
    Start in: "C:\Program Files\UJ Software\Shisen for Java\"
    Run: Normal window
    I don't suppose this will help.
    It strikes me that nobody knows for certain how to run a java app!
    I have two beginner's books, neither of which mentions anything beyond the command prompt.
    Tricks to minimize the console window are just not professional!
    The solution must be written authoritatively somewhere ...
    has anyone seen it, please?
    Increasingly disturbed ...
    Julian *(-_-)*                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to make a c program "awaken" a java socket

    I am developing a client program which has to communicate with a server written in c. I've created a listener thread which keeps verifying if there is anything in the stream:
    public void run() {
        while(true) {
                try {
                    if (input.ready()) {
                         msg = input.readLine();
    .....the problem is that the client becomes obviously quite burdening for the cpu. Is there any way I could make the listener sleep and be awakened when the socket receives data from the c server?
    I'd appreciate any kind of comments.
    Thanks

    Remove "if (input.ready())". readLine() will block, consuming zero cpu, until it gets data, EOF or an IOException.
    I've been programming sockets since mid-80's and I've never used something like socket.ready(). The normal way to do sockets is either to read() / readLine() or to select() / poll(). ready(), available() and such should come with big blinking warning labels.

  • How to make a simple login page using java creator studio and mysql

    Hi,
    I hav got java creator studio n my sql.Can u give me the code for login page authentication and navigation

    This is a forum about Java language questions, not about how to use a developers tool. I would say to go to the site where you got java creator studio from, and look for a forum there.

  • How to make MDI child - parent relationship in java using net beans/

    Hello Expers
    i am going to prepare an application in java.
    for that, i have to establish an MDI child - parent relation between various forms.
    I am preparing that application in net beans.
    Just guide me as early as possible for that as i have to submit that within three days.
    thanks.

    smuwanga
    Please don't post in old threads that are long dead. When you have a question, please start a topic of your own. Feel free to provide a link to an old thread if relevant.
    I'm locking this two year old thread now.
    db

Maybe you are looking for