在Frame1中调用
try
{
      Thread.currentThread().sleep(5000);
      this.hide();//hide frame1
      frame2.show();//show the frame2      
}catch(InterruptedException e){}其实说穿了你是不是想要一个软件初始化时显示版权信息的那种窗口?
回答我,我给你例子

解决方案 »

  1.   

    process:
    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.
      

  2.   

    xioyoo(xioyoo):
    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  
      

  3.   

    请关注下面的贴子
    http://www.csdn.net/expert/topic/701/701403.xml?temp=.7961542
      

  4.   

    xioyoo(xioyoo):
    对啊,我需要你的源代码,请发送到:
    [email protected]
      

  5.   

    import javax.swing.*;
    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();
    }
    }