|
beep, beep ... waring on 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
|