01: package org.webdocwf.util.loader.wizard;
02:
03: import java.awt.*;
04: import javax.swing.*;
05: import java.awt.event.*;
06:
07: public class OctopusSplash extends JWindow {
08: private static OctopusSplash octopusSplash;
09:
10: public OctopusSplash(String icon, JFrame f) {
11: super (f);
12: String prefixUrl = "org/webdocwf/util/loader/"
13: + "wizard/images/";
14: JLabel l = new JLabel(new ImageIcon(getClass().getClassLoader()
15: .getResource(prefixUrl + icon)));
16: getContentPane().add(l, BorderLayout.CENTER);
17:
18: Dimension dimension = Toolkit.getDefaultToolkit()
19: .getScreenSize();
20: setBounds((dimension.width - 281) / 2,
21: (dimension.height - 210) / 2, 280, 210);
22: setVisible(true);
23:
24: addMouseListener(new MouseAdapter() {
25: public void mousePressed(MouseEvent e) {
26: hideSplash();
27: }
28: });
29: setVisible(true);
30: octopusSplash = this ;
31: }
32:
33: public static OctopusSplash getSplash() {
34: return octopusSplash;
35: }
36:
37: public void hideSplash() {
38: if (isVisible()) {
39: setVisible(false);
40: dispose();
41: }
42: }
43:
44: }
|