import java.applet.* ; import java.net.URL ; import java.net.MalformedURLException ; import java.awt.Graphics ; import java.awt.Image ; import java.awt.event.* ; import java.awt.* ; public class AppletURL2 extends Applet implements ActionListener { private Button ok ; private AudioClip cucoo ; private String base ; public AppletURL2() { super() ; } public void init() { add(ok = new Button("Telechargement")); ok.addActionListener(this) ; URL url = this.getCodeBase(); base = url.toString(); } public void actionPerformed(ActionEvent e) { if ( cucoo == null ) { URL u ; try { String adresse = base+"spacemusic.au" ; u = new URL(adresse) ; cucoo = getAudioClip(u) ; cucoo.loop() ; } catch (MalformedURLException mue) { } } else { cucoo.stop() ; cucoo = null ; } } }