1 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 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 |