String clipName = "Chook.wav";
When using getResource string you pass must be either absolute or valid relative to a particular class. Since you are using ClassLoader.getResource() and not Class.getResource() , this should be an absolute path.
Without seeing your actual file hierarchy, I can only guess that “bin” is the root of your compiled classes and resources, and “ibm1260” is the package / folder inside this path, and “Chook.wav” exists in this folder. In this case, you need to use /ibm1260/Chook.wav (or potentially ibm1260/Chook.wav , I usually do not use the class loader to search for resources) as the name of the file that you pass to getResource() .
In any case, you need to make sure that the file is copied to the location of your compiled code and that the root folder is in the class path.
source share