Skip to main content

Splashscreen does not automatically close

3 replies [Last post]
skelvin
Offline
Joined: 2003-06-11
Points: 0

Not yet implemented or bug?
Javadoc says "It is closed automatically as soon as the first window is displayed by Swing/AWT".
Yet, it does not close unless explicitly closed.
I start with "java -splash:splash.png Main".
Here's the code:

import javax.swing.*;<br />
import java.awt.*;</p>
<p>public class Main {<br />
    public static void main(String[] args) throws InterruptedException {<br />
        System.out.println("Main.main");<br />
        Thread.sleep(3000);</p>
<p>        Runnable runnable = new Runnable() {<br />
            public void run() {<br />
                JFrame frame = new JFrame();<br />
                frame.setBounds(100, 100, 100, 100);<br />
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);<br />
                frame.setVisible(true);<br />
                //SplashScreen.getSplashScreen().close();<br />
            }<br />
        };<br />
        SwingUtilities.invokeLater(runnable);<br />
    }<br />
}<br />

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
bino_george
Offline
Joined: 2003-06-16
Points: 0

Hi,
This looks like a bug, although you can workaround by explicitly closing the splash screen. I will report it to
the AWT Team for investigation.

Thanks,
Bino.

bino_george
Offline
Joined: 2003-06-16
Points: 0

Hi,
This bug has already been reported and the fix is
ready, it will probably go into b45.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6272933

Regards,
Bino.

uncle_alice
Offline
Joined: 2003-06-16
Points: 0

I've noticed this, too. I thought it might be because I start my application by means of reflection, but I hadn't gotten around to testing that theory yet. I doesn't seem to hurt anything, but it's kind of disconcerting to minimize my app and find the splash screen still sitting there.