学习Java6(八)Splash(2)控制Splash时间

学习Java6(八)Splash(2)控制Splash时间
 1 import  javax.swing. * ;
 2 import  java.awt. * ;
 3
 4 public   class  DelaySplash  {
 5      public   static   void  main(String args[])  {
 6         Runnable runner  =   new  Runnable()  {
 7              public   void  run()  {
 8                  try   {
 9                     Thread.sleep( 5000 );
10                 }
  catch  (InterruptedException e)  {
11                 }

12                 JFrame frame  =   new  JFrame( " Splash " );
13                 frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
14                 JLabel label  =   new  JLabel( " 延迟 Splash 5s " , JLabel.CENTER);
15                 frame.add(label, BorderLayout.CENTER);
16                 frame.setSize( 300 95 );
17                 frame.setVisible( true );
18             }

19         }
;
20         EventQueue.invokeLater(runner);
21     }

22 }

23

运行方式和 学习Java6(八)Splash(1)HellpSplash一样

你可能感兴趣的:(学习Java6(八)Splash(2)控制Splash时间)