KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > lucane > applications > jmail > SplashFrame


1 /*
2  * Lucane - a collaborative platform
3  * Copyright (C) 2004 Vincent Fiack <vfiack@mail15.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 package org.lucane.applications.jmail;
20
21 import java.awt.*;
22
23 import javax.swing.*;
24
25 public class SplashFrame extends JFrame
26 {
27     public SplashFrame(JMailPlugin plugin)
28     {
29         ImageIcon ii = plugin.getImageIcon(plugin.getIcon());
30         
31         JLabel message = new JLabel(plugin.tr("splash.waitMessage"));
32         message.setOpaque(true);
33         message.setBackground(Color.WHITE);
34         message.setHorizontalAlignment(JLabel.CENTER);
35         message.setIcon(ii);
36         message.setIconTextGap(20);
37         
38         
39                 
40         JProgressBar bar = new JProgressBar();
41         bar.setIndeterminate(true);
42         bar.setBorder(BorderFactory.createLineBorder(Color.WHITE, 5));
43
44         getContentPane().setLayout(new BorderLayout());
45         getContentPane().add(message, BorderLayout.CENTER);
46         getContentPane().add(bar, BorderLayout.SOUTH);
47         
48         setSize(400, 150);
49         this.rootPane.setBorder(BorderFactory.createLineBorder(Color.BLACK, 1));
50         
51         Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
52         setLocation((d.width-getWidth())/2, (d.height-getHeight())/2);
53         this.setUndecorated(true);
54     }
55 }
Popular Tags