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.
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);
}
}
That won't work the way you have. You MUST implement Runnable and override the run() method. Inside the run method is where you create the delay.
You haven't tried it have you? There is an executable in my attachment which should emphasise my point. LOL.
I mean to say, it works on my computer but fails to work on my friends computer. Has anyone else tried it? And I know she has Java run time environment on hers but some appears to be wrong.
Please try my code. The main class is TestSplash.java
I got a frame called a dummy frame, but that was it. Nothing was on the frame or anything. Is your friend recieving an error message? Does the console icon appear in the system tray?
I got a frame called a dummy frame, but that was it. Nothing was on the frame or anything. Is your friend recieving an error message? Does the console icon appear in the system tray?
You need to make sure the path to your splash screen image is actually there.
As long as the picture is actually in your c: directory and is of a png or jpeg form it should display. Tell me if this works for you. Thanks
[Edit] To illustrate my point, I have kindly attached a zip file. Which should contain the executable and the png picture. However, in order for the path to be recognised you have to EXTRACT the zipped file. Which can be done by right clicking the folder and selecting extract all... Assuming of course, you are using windows as your OS [/Edit]
Can you see what the problem is server crash? Did it work what I said. I followed instructions you gave me previously about creating a jar executable file, and the manifest crap. Is that working?
And the splash screen image I coded using javaOpengl, however, the rendering was a bit sluggish. It that took ages but I just followed the tutorials. Simple really.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.