Results 1 to 2 of 2
  1. #1
    thuan1975 is offline Member
    Join Date
    Mar 2011
    Posts
    1
    Rep Power
    0

    Default beep, beep ... waring in java code

    hi all.

    I use Textpad and SciTE to coding java under Win7 and Fedora Core 13.
    but with source code as below, I see different to Win7 and FC13.
    under Win7, this code show beep, beep ... warning
    but
    under FC3, no thing warning.
    (note, this source code is execute under only one machine (I install dual OS on one machine) and sound card can play very good, I can hear mp3 on both Win7, FC13)

    If you have any solution to beep, beep ... warning on FC13.
    Please, help me.

    Thank you, for your reply.




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

    public class timer_beep {
    public static void main(String args[])throws IOException {
    try{
    System.out.println("BeepTesting start!");
    for(int x=0;x<=9;x++) {
    System.out.println(x);
    Toolkit.getDefaultToolkit().beep();
    Thread.sleep(2000);
    } //for
    System.out.println("BeepTesting end!");

    System.out.println("BeepTesting start!");
    boolean myBeep = true;
    int i=0;
    while(myBeep) {
    System.out.println(i);
    i++;
    Toolkit.getDefaultToolkit().beep();
    Thread.sleep(2000);
    if(i==10){
    myBeep=false;
    }//if
    }//while
    System.out.println("BeepTesting end!");
    } //try
    catch(InterruptedException e) {
    System.out.println("InterruptedException:" + e);
    }
    } //main
    } //class

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. How to detect beep sound using java
    By dkas in forum New To Java
    Replies: 10
    Last Post: 02-09-2011, 11:07 PM
  2. Toolkit.getDefaultToolkit().beep() does not work
    By adelfa in forum New To Java
    Replies: 8
    Last Post: 11-10-2010, 06:05 AM
  3. Java ME beep(frequency, time)
    By Morfmor in forum New To Java
    Replies: 2
    Last Post: 08-28-2008, 10:34 PM
  4. Beep
    By JavaLerner in forum New To Java
    Replies: 3
    Last Post: 07-16-2008, 10:17 AM
  5. How to beep every 5 minutes in Java
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-16-2008, 10:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •