Class SplashWindow

  • All Implemented Interfaces:
    ImageObserver, MenuContainer, Serializable, Accessible

    public class SplashWindow
    extends Window
    A Splash window.

    Usage: MyApplication is your application class. Create a Splasher class which opens the splash window, invokes the main method of your Application class, and disposes the splash window afterwards. Please note that we want to keep the Splasher class and the SplashWindow class as small as possible. The less code and the less classes must be loaded into the JVM to open the splash screen, the faster it will appear.

     class Splasher {
         public static void main(String[] args) {
             SplashWindow.splash(Startup.class.getResource("splash.gif"));
             MyApplication.main(args);
             SplashWindow.disposeSplash();
         }
     }
     
    Author:
    Werner Randelshofer
    See Also:
    Serialized Form
    • Method Detail

      • update

        public void update​(Graphics g)
        Updates the display area of the window.
        Overrides:
        update in class Container
      • paint

        public void paint​(Graphics g)
        Paints the image on the window.
        Overrides:
        paint in class Window
      • splash

        public static void splash​(Image image)
        Open's a splash window using the specified image.
        Parameters:
        image - The splash image.
      • splash

        public static void splash​(URL imageURL)
        Open's a splash window using the specified image.
        Parameters:
        imageURL - The url of the splash image.
      • disposeSplash

        public static void disposeSplash()
        Closes the splash window.
      • invokeMain

        public static void invokeMain​(String className,
                                      String[] args)
        Invokes the main method of the provided class name.
        Parameters:
        args - the command line arguments