Loads a clip from the resource directory.
Parameter:
//package com.java2s; import java.applet.Applet; import java.applet.AudioClip; import java.net.URL; public class Main { private static String resources = ""; private static ClassLoader loader; /**/*w w w. d e m o 2 s. c o m */ * Loads a clip from the resource directory. * * @param filename * => The name of the file in the resource directory. */ public static AudioClip loadClip(String filename) throws Exception { URL url = loader.getResource(resources + filename); return Applet.newAudioClip(url); } }