Demos and Usage of java.applet.Applet.newAudioClip(URL url)


   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AudioClip;
   5: import java.net.URL;
   6: import java.net.MalformedURLException;

View Full Code Here
   1: import java.applet.*;
   2: import java.awt.*;
   3:         ...
   4:     java.io.File file = new java.io.File( args[0] );
   5:     final AudioClip sound = Applet.newAudioClip(file.toURL(  ));
   6: 
   7:     JButton button = new JButton("Woof!");
   8:     button.addActionListener(new ActionListener(  ) {

View Full Code Here
   1: import java.applet.*;
   2: import java.net.*;
   3:         ...
   4:                 URL snd = new URL(av[i]);
   5:                 Applet.newAudioClip(snd).play();
   6:             } catch (Exception e) {
   7:                 System.err.println(e);
   8:             }

View Full Code Here
   1: 
   2: import java.applet.*;
   3: 
   4:         ...
   5:       try {
   6:          return Applet.newAudioClip( getClass().getResource( 
   7:             prefix + soundFile ) );
   8:       }

View Full Code Here
   1: import java.awt.event.*;
   2: import java.applet.*;
   3: import java.io.*;
   4:         ...
   5: 
   6:         AudioClip clip = Applet.newAudioClip(getClass().getResource("/splash.mid"));
   7:         clip.play();
   8:     }

View Full Code Here
   1: import java.awt.Image;
   2: import java.applet.*;
   3: import java.net.URL;
   4:         ...
   5: 
   6: public static AudioClip sound = Applet.newAudioClip(getURL(baseURL + "sound.wav"));
   7: 
   8:   private static boolean fixIcons()
   9:   {

View Full Code Here
   1: import java.io.File;
   2: import java.applet.AudioClip;
   3:         ...
   4: import java.applet.Applet;
   5: import java.awt.*;
   6:         ...
   7:         URL u = getResourceUrl(nazwa);
   8:         AudioClip clip = Applet.newAudioClip(u);
   9:         return clip;

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AppletContext;
   5:         ...
   6: import java.applet.AudioClip;
   7: import java.awt.Image;
   8:         ...
   9:   {
  10:     return Applet.newAudioClip(url);

View Full Code Here
   1: package org.opensourcephysics.tools;
   2: import java.applet.*;
   3: import java.io.*;
   4:         ...
   5:     if(clip==null&&getURL()!=null) {
   6:       clip = Applet.newAudioClip(getURL());
   7:     }
   8:     return clip;
   9:   }

View Full Code Here
   1: 
   2: import java.applet.Applet;
   3:         ...
   4: import java.applet.AudioClip;
   5: import java.io.File;
   6:         ...
   7: 
   8:                                 audio_clip = Applet.newAudioClip( file_url );
   9:                             }
  10:         ...
  11: 
  12:                         audio_clip = Applet.newAudioClip(UserAlerts.class.getClassLoader().getResource( default_sound ));

View Full Code Here
   1: 
   2: package xxx.applet;
   3: 
   4:         ...
   5: import java.applet.*;
   6: import java.awt.*;
   7:         ...
   8:     String t=getClass().getName();
   9:     h.setName ("Applet"+t);
  10:     h.setTitle("Applet"+t);
  11:         ...
  12:   {
  13:     return Applet.newAudioClip(url);

View Full Code Here