Combining NetBeans and Splashscreens

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:

  1. 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.
  2. Go to Project Properties, Run and in the VM Options type:
    -splash:src/images/splash.gif.
    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.
  3. Next, edit the manifest.mf file you can find in your project root. Add the following line:
    SplashScreen-Image: images/splash.gif
    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! 😉

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s