Ejemplo n.º 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();
 }
Ejemplo n.º 3
0
 public static void playSound(String fileName) {
   AudioClip audioClip =
       JApplet.newAudioClip(new DontForgetTheLyrics().getClass().getResource(fileName));
   audioClip.play();
 }