FileDocCategorySizeDatePackage
Splash.javaAPI DocExample1177Sun Feb 03 15:52:34 GMT 2002com.darwinsys.util

Splash

public class Splash extends JWindow
A simple Splash screen.

Fields Summary
protected ImageIcon
im
Constructors Summary
public Splash(JFrame f, String progName, String fileName)

		super();
		// Can't use Swing border on JWindow: not a JComponent.
		// setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
		im = new ImageIcon(fileName);
		if (im.getImageLoadStatus() != MediaTracker.COMPLETE)
			JOptionPane.showMessageDialog(f,
				"Warning: can't load image " + fileName + "\n" +
				"Please be sure you have installed " + progName + " correctly",
				"Warning",
				JOptionPane.WARNING_MESSAGE);
		int w = im.getIconWidth(), h = im.getIconHeight();
		setSize(w, h);
		UtilGUI.center(this);
		addMouseListener(new MouseAdapter() {
			public void mouseClicked(MouseEvent e) {
				dispose();
			}
		});
		addKeyListener(new KeyAdapter() {
			public void keyTyped(KeyEvent e) {
				dispose();
			}
		});
	
Methods Summary
public voidpaint(java.awt.Graphics g)

		im.paintIcon(this, g, 0, 0);
		g.setColor(Color.green);
		g.drawRoundRect(0, 0, getWidth()-1, getHeight()-1, 7, 7);