01: package net.xoetrope.builder.editor;
02:
03: import javax.swing.JWindow;
04: import javax.swing.ImageIcon;
05: import javax.swing.JLabel;
06: import java.awt.Dimension;
07: import java.awt.Toolkit;
08: import javax.swing.JFrame;
09:
10: /**
11: * A simple splash screen window
12: * <p> Copyright (c) Xoetrope Ltd., 2002-2003</p>
13: * <p> $Revision: 1.1 $</p>
14: * <p> License: see License.txt</p>
15: */
16: public class XSplashScreen extends JWindow {
17: public XSplashScreen(JFrame frame) {
18: super (frame);
19:
20: ImageIcon image = new ImageIcon(this .getClass().getResource(
21: "/splash.png"));
22: JLabel label = new JLabel(image);
23: getContentPane().add(label);
24: pack();
25: Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
26: int x = (int) (dim.getWidth() - getWidth()) / 2;
27: int y = (int) (dim.getHeight() - getHeight()) / 2;
28: setLocation(x, y);
29: }
30: }
|