1 2 package org.catacomb.icon.splash; 3 4 import java.awt.Dimension; 5 import java.awt.Frame; 6 import java.awt.Graphics; 7 import java.awt.Window; 8 import java.awt.image.BufferedImage; 9 10 11 public class SplashWindow extends Window { 12 static final long serialVersionUID = 1001; 13 14 BufferedImage image; 15 16 Dimension dim; 17 18 public SplashWindow(BufferedImage img, Frame f) { 19 super(f); 20 21 image = img; 22 23 dim = new Dimension(image.getWidth(), image.getHeight()); 24 } 25 26 27 public void update(Graphics g) { 28 paint(g); 29 } 30 31 32 public void paint(Graphics g) { 33 g.drawImage(image, 0, 0, this); 34 } 35 36 37 public Dimension getPreferredSize() { 38 return dim; 39 40 } 41 42 43 public void packShow() { 44 pack(); 45 setVisible(true); 46 } 47 48 }