001/*
002 * Copyright (c) 1999-2001 Keiron Liddle, Aftex Software
003 *
004 * This library is free software; you can redistribute it and/or
005 * modify it under the terms of the GNU Lesser General Public
006 * License as published by the Free Software Foundation; either
007 * version 2.1 of the License, or (at your option) any later version.
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012 * Lesser General Public License for more details.
013 *
014*/
015package com.aftexsw.ui;
016
017import com.aftexsw.util.*;
018
019import javax.swing.*;
020import java.awt.*;
021
022public class Splash extends JWindow implements Perishable {
023        public Splash() {
024                this("Initializing...", "images/aftexsw.jpeg");
025        }
026
027        public Splash(String desc, String im) {
028                getContentPane().setLayout(new BorderLayout());
029                Image logo = null;
030                try {
031                        logo = Toolkit.getDefaultToolkit().getImage(getClass().getResource(im));
032                } catch (Exception e) {}
033
034
035                if (logo != null) {
036                        JLabel canvas = new JLabel(new ImageIcon(logo));
037                        getContentPane().add(canvas, BorderLayout.NORTH);
038                }
039                JLabel lab1 = new JLabel(desc, JLabel.CENTER);
040                JLabel lab2 = new JLabel("Keiron Liddle, Aftex Software (C) 1999-2002", JLabel.CENTER);
041                getContentPane().add(lab1, BorderLayout.CENTER);
042                getContentPane().add(lab2, BorderLayout.SOUTH);
043                Util.centerFrame(this);
044        }
045
046        public void perish() {
047                dispose();
048        }
049}