2008年1月23日 星期三

how to get resource

1. get Class object of the class that has resource

2. if resource is image or audio , use getResource(String name) to get resource as a URL.
Then read it with getImage or getAudioClip

3. other resource use getResourceAsStream(String name) to get InputStream to read.

沒有留言: