• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SplashScreen

 
Philip Pross
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic