kiwi.ui
Class SplashScreen

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--kiwi.ui.SplashScreen

public class SplashScreen
extends Window

This class represents a splash screen: an untitled, frameless window that briefly appears on the desktop, typically while an application or installer program is launching. A SplashScreen contains an image and, optionally, a one-line textual caption. It is drawn with a 1-pixel wide black border and appears at the center of the screen when shown. The SplashScreen appears above all other windows on the desktop.

As with all Components, the setForeground() and setBackground() methods may be called to change the appearance of the splash screen.


An example SplashScreen.

Version:
1.0.1 (10/98)
Author:
Mark Lindner, PING Software Group
See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
SplashScreen(Image image, String caption)
          Construct a new SplashScreen.
 
Method Summary
 Dimension getPreferredSize()
          Get the splash screen's preferred size.
 void paint(Graphics gc)
          Paint the splash screen.
 void setDelay(int seconds)
          Set the display duration.
 void setVisible(boolean flag)
          Display or hide the splash screen.
 
Methods inherited from class java.awt.Window
addNotify, addWindowListener, applyResourceBundle, applyResourceBundle, dispose, finalize, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isShowing, pack, postEvent, processEvent, processWindowEvent, removeWindowListener, show, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SplashScreen

public SplashScreen(Image image,
                    String caption)
Construct a new SplashScreen.
Parameters:
image - The image to display in the splash screen.
caption - A short text caption to display below the image (may be null).
Method Detail

setDelay

public void setDelay(int seconds)
              throws IllegalArgumentException
Set the display duration.
Parameters:
seconds - The number of seconds that the splash screen should remain onscreen before it is automatically hidden. If 0, it will remain onscreen until explicitly hidden via a call to setVisible() or dispose().
Throws:
IllegalArgumentException - If seconds is less than 0.

paint

public void paint(Graphics gc)
Paint the splash screen.
Overrides:
paint in class Container

setVisible

public void setVisible(boolean flag)
Display or hide the splash screen. The splash screen is displayed on the desktop, centered on the screen. Although this method returns immediately, the splash screen remains on the desktop for the duration of the time delay, or indefinitely if the delay was set to 0.
Overrides:
setVisible in class Component

getPreferredSize

public Dimension getPreferredSize()
Get the splash screen's preferred size.
Returns:
The preferred size of the component.
Overrides:
getPreferredSize in class Container