Talk:Main Page

Revision as of 18:23, 1 July 2010 by Areeda (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)

Add a Splash Screen to a Java Desktop Application

I spent about a day researching how to do this. It is easy and takes 10 minutes once you know the procedure.

A splash page is useful when the application has an initialization procedure that can take a significant amount of time. It may also contain useful marketing information.

To start use NetBeans to create an empty Desktop Application. File:EmptyProject.png

To add a Splash create an image but leave some space for additions in the next part. Many formats are available, I use PNG, JPEG and GIF. (@todo - add list of all acceptable formats). spl

Copy your Splash Screen image to the resources folder in your project. The NetBeans project template already contains a file named splash.png, replace it with your own.

Next, from the files tree open File:ManifestSelect.png

Add the SplashScreen-Image tag. Manifest-Version: 1.0 SplashScreen-Image: splashdemo/resources/splash.png X-COMMENT: Main-Class will be added automatically by build

Build the project and execute the jar. The splash screen will display. At this point the splash screen will not display when you run or debug the project from the NetBeans IDE.

To get the splash screen to display with the run or debug command from the IDE edit the Run properties and add to the VM options field splash:src/<packagename>/resources/splash.png

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo