KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > jawe > JaWESplash


1 /* PESplash.java
2  *
3  * Authors:
4  * Stefanovic Nenad chupo@iis.ns.ac.yu
5  * Bojanic Sasa sasaboy@neobee.net
6  * Puskas Vladimir vpuskas@eunet.yu
7  * Pilipovic Goran zboniek@uns.ac.yu
8  *
9  */

10
11 package org.enhydra.jawe;
12
13 import java.awt.*;
14 import javax.swing.*;
15 import java.awt.event.*;
16
17
18 public class JaWESplash extends JWindow {
19    private static JaWESplash jaweSplash;
20
21    public JaWESplash(String JavaDoc icon, JFrame f, int waitTime) {
22       super(f);
23       JLabel l = new JLabel(new ImageIcon(ResourceManager.getResource(icon)));
24       getContentPane().add(l, BorderLayout.CENTER);
25
26       Utils.center(this,100,200);
27
28       addMouseListener(new MouseAdapter() {
29          public void mousePressed(MouseEvent e) {
30             hideSplash();
31          }
32       });
33       setVisible(true);
34       jaweSplash=this;
35    }
36
37    public static JaWESplash getSplash () {
38       return jaweSplash;
39    }
40
41    public void hideSplash () {
42       if (isVisible()) {
43          setVisible(false);
44          dispose();
45       }
46    }
47
48 }
49
50
Popular Tags