wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes SplashScreen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "SplashScreen " Watch "SplashScreen " New topic
Author

SplashScreen

Philip Pross
Ranch Hand

Joined: Jan 17, 2001
Posts: 76
I have a problem with a SplashScreen over the internet usinfg with applets. I want to call this class after a user has loged in correctly,
because before it would take a minute and a half before my main class can be loaded, so when I try to call my SplashScreen all I see is
status bar "Warning ...".
Does anyone have any idea why ...... here is my code
LOGIN FRAME CLASS
if (sLine = true)
SplashScreen s = SplashScreen();
SPLASHSCREEN CLASS

import javax.swing.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
public class SplashScreen extends JWindow
{
public SplashScreen()
{
SplashScreen intro = new SplashScreen(,
"(C) Copyright 2000, Department Java, All Rights Reserved" );
intro.showFor(5000);
}

public SplashScreen(String text)
{
ImageIcon icon = null;
JPanel contentPane = new JPanel();
contentPane.setLayout(new BorderLayout());
Border bd1 = BorderFactory.createBevelBorder(BevelBorder.RAISED);
Border bd2 = BorderFactory.createEtchedBorder();
Border bd3 = BorderFactory.createCompoundBorder(bd1, bd2);
((JPanel)contentPane).setBorder(bd3);
try
{
icon = new ImageIcon(new URL (MyApplet.getCodebase()+"duke.gif") );
}
catch(MalformedURLException mue)
{
System.out.println("error");
}
contentPane.add("North", new JLabel(" ", JLabel.CENTER));
contentPane.add("Center", new JLabel(icon, JLabel.CENTER));
contentPane.add("South", new JLabel(text, JLabel.CENTER));
setContentPane(contentPane);
}
public void showFor(int millis)
{
Dimension dim = Toolkit.getDefaultToolkit().getScreenSize();
setLocation(dim.width / 3, dim.height / 3);
setSize(dim.width / 3, dim.height / 3);
setVisible(true);
try
{
Thread.sleep(millis);
}
catch (InterruptedException e)
{
}
setVisible(false);
}
public SplashScreen()
{
SplashScreen intro = new SplashScreen(,
"(C) Copyright 2000, Java Department , All Rights Reserved" );
intro.showFor(5000);
}
}
Sayed Ibrahim Hashimi
Ranch Hand

Joined: May 17, 2001
Posts: 148
Maybe the problem is that most browsers don't support Swing. Does the user of your applet have the Java plug-in loaded on his machine?


SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
 
 
subject: SplashScreen
 
Similar Threads
Display Frame on Center of Screen
BigDecimal issue
type mismatch in swing is it??
Moving a picture down a bit
Image Icons