diff options
| author | Paul Buetow <paul@buetow.org> | 2009-02-18 17:33:22 +0000 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2009-02-18 17:33:22 +0000 |
| commit | 4722100cba287b164957c658c2e035783e20c963 (patch) | |
| tree | 35733fd3e50aeeb493e38ceaea83521a4710f0ac /sources/client/SplashScreen.java | |
| parent | 61f7175cc3e51c0afaf63e380d03824a77464ba8 (diff) | |
moved sources
Diffstat (limited to 'sources/client/SplashScreen.java')
| -rw-r--r-- | sources/client/SplashScreen.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sources/client/SplashScreen.java b/sources/client/SplashScreen.java new file mode 100644 index 0000000..6ad8416 --- /dev/null +++ b/sources/client/SplashScreen.java @@ -0,0 +1,42 @@ +package client; + +import java.awt.*; +import javax.swing.*; +import shared.*; + +public class SplashScreen extends JWindow implements Runnable { + private static final long serialVersionUID = 1L; + + /** + * A simple little method to show a title screen in the center + * of the screen for the amount of time given in the constructor + */ + public void run() { + JPanel jPanel = (JPanel)getContentPane(); + jPanel.setBackground(Color.BLACK); + jPanel.setForeground(Color.WHITE); + + // Set the window's bounds, centering the window + int iWidth = 411; + int iHeight = 261; + Dimension dimension = Toolkit.getDefaultToolkit().getScreenSize(); + + int x = (dimension.width-iWidth)/2; + int y = (dimension.height-iHeight)/2; + setBounds(x,y,iWidth,iHeight); + + JLabel jLabel = new JLabel(new ImageIcon("images/netcal.png")); + jPanel.add(jLabel, BorderLayout.CENTER); + jPanel.setBorder(BorderFactory.createLineBorder(Color.BLACK, 3)); + setVisible(true); + + try { + Thread.sleep(3000); + + } catch (Exception e) { + Main.infoMessage(e.getMessage()); + } + + dispose(); + } +}
\ No newline at end of file |
