Пример #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();
 }