Paul Gordon,您好! Thank you ,Paul Gordon and Alessandro Borges. I changed my code to URL myURL = this.getClass().getClassLoader().getResource(filename) and so it run! thanks again.
======= 2004-08-05 22:27:00 您在来信中写道:======= >I have generally found that the most stable way to load a resource is >with the class loader. If you're running from a Jar, it generates jar >URL's, if it's a file it generates file:// URL's, etc. etc. So your code >would look like this: > >URL clipURL = this.getClass().getClassLoader().getResource("audio/audio1.wav"); >if(clipURL == null){ > //Oops. >} > >AudioClip crowdcheer = getAudioClip(clipURL); > >> >>some codes as following: >>*************************************************************************** >>load audio: >>.. >>AudioClip crowdcheer = getAudioClip(codeBase, "audio/audio1.wav"); >>.. >>*************************************************************************** >> >> > >=========================================================================== >To unsubscribe, send email to [EMAIL PROTECTED] and include in the body >of the message "signoff JAVA3D-INTEREST". For general help, send email to >[EMAIL PROTECTED] and include in the body of the message "help". = = = = = = = = = = = = = = = = = = = = =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA3D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".