?? trainwhistle.java
字號:
import java.applet.*;
import java.net.*;
public class TrainWhistle {
public static void main(String[] arguments) {
try {
URL bgSoundFile = new URL("file:train.wav");
AudioClip bgSound = Applet.newAudioClip(bgSoundFile);
URL beepFile = new URL("file:whistle.wav");
AudioClip beep = Applet.newAudioClip(beepFile);
if (bgSound != null)
bgSound.loop();
for (int i = 0; i < 10; i++) {
try {
Thread.sleep(9000);
if (beep != null)
beep.play();
} catch (InterruptedException e) { }
}
} catch (MalformedURLException mue) {
System.out.println("Bad URL: " + mue.getMessage());
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -