The trick is not to get wet 😉
So let’s get to it. I’ve read tens of articles on the web, claiming they know how to make NetBeans display a splash screen image (using the JDK 6 approach). This article shows you how to do it quickly and was tested with NetBeans 5.5.How you should do it:
- Add your splash screen image to src/images/splash.gif under your NetBeans directory. You can place it anywhere, but just make sure it is inside your src/ directory.
- Go to Project Properties, Run and in the VM Options type:
Note the extra src/. This is what most authors forget to mention, that NetBeans doesn’t put that there. Also note that putting INSIDE the src dir guarantees that it will also be included in the jar file.
- Next, edit the manifest.mf file you can find in your project root. Add the following line:
Here, note that you should NOT include the src/. It will then be added to your jar’s manifest file, and it will make the splash screen available at startup.
Step 2 is needed for displaying the splash screen when running the project inside NetBeans.
Step 3 is needed when running the jar file.
If you have any questions or bugs, leave a comment.
Good luck splashing! 😉