在Frame1中调用
try
{
Thread.currentThread().sleep(5000);
this.hide();//hide frame1
frame2.show();//show the frame2
}catch(InterruptedException e){}其实说穿了你是不是想要一个软件初始化时显示版权信息的那种窗口?
回答我,我给你例子
try
{
Thread.currentThread().sleep(5000);
this.hide();//hide frame1
frame2.show();//show the frame2
}catch(InterruptedException e){}其实说穿了你是不是想要一个软件初始化时显示版权信息的那种窗口?
回答我,我给你例子
1.Show the Frame1,waitting for 5 second.
2.if Time out,Frame1.setVisible( false )
3.Show the Frame2 now.Of course,u can destroy the Frame1 after used.
I don't consider that ur code will get the purpose.
Should be below:
try
{
Thread.currentThread().sleep(5000);
}catch(InterruptedException e){}this.hide();//hide frame1
frame2.show();//show the frame2
http://www.csdn.net/expert/topic/701/701403.xml?temp=.7961542
对啊,我需要你的源代码,请发送到:
[email protected]
import java.awt.*;
public class FrameTest
{
public static void main(String[] args)
{
JFrame frame1=new JFrame("JFrame1");
JFrame frame2=new JFrame("JFrame2");
frame1.setBounds(100,100,100,100);
frame2.setBounds(100,100,200,200);
frame1.show();
try
{
Thread.currentThread().sleep(5000);
}
catch(InterruptedException e){}
frame1.hide();
frame2.show();
}
}