随笔 - 119  文章 - 3173  trackbacks - 0
<2007年4月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
293012345

交友莫独酒,茅台西凤游。
口干古井贡,心徜洋河流。
称多情杜康,趟无量双沟。
赞中华巍巍,无此不销愁。

常用链接

留言簿(68)

随笔分类(136)

随笔档案(122)

最新随笔

搜索

  •  

积分与排名

  • 积分 - 520594
  • 排名 - 93

最新评论

 1 public   class  CmdSplash  {
 2      /**
 3      *  @param  str
 4       */

 5      public   static   void  main(String[] str)  {
 6         System.out.println( " test " );
 7     }

 8
 9 }

10

 1 import  org.eclipse.swt.SWT;
 2 import  org.eclipse.swt.widgets.Display;
 3 import  org.eclipse.swt.widgets.Shell;
 4
 5
 6 public   class  SwtSplash  extends  Shell  {
 7
 8      /**
 9      * Launch the application
10      *  @param  args
11       */

12      public   static   void  main(String args[])  {
13          try   {
14             Display display  =  Display.getDefault();
15             SwtSplash shell  =   new  SwtSplash(display, SWT.SHELL_TRIM);
16             shell.open();
17             shell.layout();
18              while  ( ! shell.isDisposed())  {
19                  if  ( ! display.readAndDispatch())
20                     display.sleep();
21             }

22         }
  catch  (Exception e)  {
23             e.printStackTrace();
24         }

25     }

26
27      /**
28      * Create the shell
29      *  @param  display
30      *  @param  style
31       */

32      public  SwtSplash(Display display,  int  style)  {
33          super (display, style);
34         createContents();
35     }

36
37      /**
38      * Create contents of the window
39       */

40      protected   void  createContents()  {
41         setText( " SWT Application " );
42         setSize( 500 375 );
43          //
44     }

45
46     @Override
47      protected   void  checkSubclass()  {
48          //  Disable the check that prevents subclassing of SWT components
49     }

50
51 }

52

按照上面几篇文章的方法测试这两个“骨头程序”,可以看到命令行程序和SWT程序同样可以享受到JAVA6带来的Splash
posted on 2007-04-15 23:22 交口称赞 阅读(1182) 评论(1)  编辑  收藏 所属分类: Java6

FeedBack:
# re: 学习Java6(八)Splash(4)Splash其它 2007-04-18 08:42 开源英汉机器翻译
开源英汉机器翻译.

开源英汉机器翻译C#.NET项目 www.liebiao.net

我们邀请你 技术交流  回复  更多评论
  

只有注册用户登录后才能发表评论。


网站导航: