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
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一样