Hi people, I am having trouble with my splash screen. Basically, it just flashes really quickly and I can't get to to pause for long enough. See attached file.
I've attached my program as a zipped file.
After you have download it you need to right click and extract it otherwise it won't work.
Awaiting your earliest reply.
God bless.
Here's the code:
import java.awt.*;
import java.awt.event.*;
public class TestSplash {
MyFrame theFrame;
public static void main (String args[]){
TestSplash t = new TestSplash();
t.createMainFrame();
}
private void createMainFrame() {
theFrame = new MyFrame("A Dummy Frame");
theFrame.setVisible(true);
}
}
class MyFrame extends Frame {
Splash mySplash;
public MyFrame(String title){
super(title);
addWindowListener
(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
}
);
mySplash = new Splash(this, "blart.png");
// dummy delay so we can see the Splash!
for(int i = 0; i < 50000; i++) { //PROBLEM HERE
System.out.println(i) ;
}
setSize(200,200);
}
}