KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > quickserver > net > qsadmin > gui > SplashScreen


1 /*
2  * This file is part of the QuickServer library
3  * Copyright (C) 2003-2005 QuickServer.org
4  *
5  * Use, modification, copying and distribution of this software is subject to
6  * the terms and conditions of the GNU Lesser General Public License.
7  * You should have received a copy of the GNU LGP License along with this
8  * library; if not, you can download a copy from <http://www.quickserver.org/>.
9  *
10  * For questions, suggestions, bug-reports, enhancement-requests etc.
11  * visit http://www.quickserver.org
12  *
13  */

14
15 package org.quickserver.net.qsadmin.gui;
16
17 import java.awt.*;
18 import javax.swing.*;
19 import javax.swing.border.*;
20 import java.awt.event.*;
21 import org.quickserver.swing.JFrameUtilities;
22
23 public class SplashScreen extends JWindow {
24     protected ImageIcon logo;
25     protected JLabel productName;
26
27     public SplashScreen() {
28         logo = new ImageIcon(getClass().getClassLoader().getResource("icons/logo.png"));
29         productName = new JLabel("<html><font face=\"Verdana\" size=\"3\"> Loading..</font><br>"+
30             "<font face=\"Verdana\" size=\"5\">QSAdminGUI</font>",logo,JLabel.CENTER);
31         productName.setBackground(new Color(238,238,230,255));//Color.white);
32
productName.setOpaque(true);
33         
34         productName.setBorder(BorderFactory.createCompoundBorder(
35             BorderFactory.createEmptyBorder(10,10,10,10),
36             BorderFactory.createLineBorder(Color.black) ));
37         getContentPane().add(productName);
38         Dimension dim=productName.getPreferredSize();
39         dim.setSize(dim.getWidth()+10,dim.getHeight()+10);
40         setSize(dim);
41         JFrameUtilities.centerWindow(this);
42         setVisible(true);
43     }
44     
45     public void kill() {
46         dispose();
47     }
48 }
49
Popular Tags