Go to the “Files” tab and navigate to your projects “src” folder. Move the directories for your resource out of the src folder to exclude them from the main jar, so you have for example the following folder structure:
+ <YourProject>
+ audio
+ nbproject
+ sprites
+ src
(...)
Then open your build.xml file and add the following target:
<target name="-post-jar">
<mkdir dir="${dist.dir}/lib"/>
<jar destfile="${dist.dir}/lib/${ant.project.name}-audio.jar" basedir="audio"/>
<jar destfile="${dist.dir}/lib/${ant.project.name}-sprites.jar" basedir="sprites"/>
</target>
This will create two additional jars under dist ("-audio.jar" and “-sprites.jar”) with the contents of your audio and sprites folder.
After that switch back to the “Projects” tab and open your projects properties. Add the “audio” and “sprites” folder to the run-time libraries under the “Run” tab in the “Libraries” category. This last step is required to let your app load from your resource folders when starting from within the IDE.
Clean and build the project.
To let NetBeans correctly create a JNLP file for Web Start, open the project properties, Go to the “Application->Web Start” category and check the “Enable Web Start” box. Now open the “Libraries” category and switch to the “Run” tab again. For the JNLP-File to include your resource jars they have to be referenced as run-time libraries, so add “-audio.jar” and “-sprites.jar” to the list, too.