Application Customization

Application Icon

To replace the application icon, which appears in the top left corner of a Swing-based frame, you must override the getApplicationIconImage() method of the SwingApplicationFrame. In HelloWorld.java it looks like this:

protected Image getApplicationIconImage()
{
  return Toolkit.getDefaultToolkit().getImage(
      GUIResource.class.getResource("icons/dialog/tensign.gif")); 
}

Replacing the Splash Screen

To replace the splash screen image which appears during application initialization, programmers should override the getSplashScreenImage() method of the SwingApplicationFrame. The following example shows how:

protected Image getSplashScreenImage()
{
    return Toolkit.getDefaultToolkit().getImage(
        GUIResource.class.getResource("icons/dialog/splash.jpg"));         
}

The SwingApplicationFrame provides the following methods to further customize the appearance of the splash screen.

  • Color getSplashBackground()

    Returns the background color of the splash screen

  • Color getSplashForeground()

    Returns the foreground color for the splash screen

  • Color getSplashRectColor()

    This method returns an instance of Color which is used by the SplashScreen to color the progress bar.

  • Image getSplashScreenImage()

    Returns null. Subclasses may override this method to specify a custom splashscreen image. If no such image is specified the default Tensegrity Splash will be used.

  • Insets getSplashWindowInsets()

    Returns the insets dividing the splash window contents from the border.

  • boolean showSplashScreen()

    Returns true, if the splash screen should be shown.