CeciliA CeciliA - 1 year ago 70
Java Question

How can I call JFrame with another JFrame after 2 Seconds Delay?

new SplashDemoGUI().setVisible(true);
try {
new sample().setVisible(true);
} catch (InterruptedException ex) {


Maybe someone can help me, I`ve put it in public main.

Answer Source
new java.util.Timer().schedule( 
    new java.util.TimerTask() {
        public void run() {
            new sample().setVisible(true);

This should do the job.


JFrame hints at Swing, so it seems Swing Timer will be appropriate. – PM 77

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download