예제 #1
0
 private void playSound(String fileName) {
   AudioClip sound = JApplet.newAudioClip(getClass().getResource(fileName));
   sound.play();
 }
 private void playMusic(String nameOfSoundFile) {
   AudioClip sound = JApplet.newAudioClip(getClass().getResource(nameOfSoundFile));
   sound.play();
 }
예제 #3
0
 public static void playSound(String fileName) {
   AudioClip audioClip =
       JApplet.newAudioClip(new DontForgetTheLyrics().getClass().getResource(fileName));
   audioClip.play();
 }