学习Java6(八)Splash(3)Splash其它

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 *Launchtheapplication
10 * @param args
11 */

12 public static void main(Stringargs[]) {
13 try {
14 Displaydisplay = Display.getDefault();
15 SwtSplashshell = 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 (Exceptione) {
23 e.printStackTrace();
24 }

25 }

26
27 /***/ /**
28 *Createtheshell
29 * @param display
30 * @param style
31 */

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

36
37 /***/ /**
38 *Createcontentsofthewindow
39 */

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

45
46 @Override
47 protected void checkSubclass() {
48 // DisablethecheckthatpreventssubclassingofSWTcomponents
49 }

50
51 }

52

按照上面几篇文章的方法测试这两个“骨头程序”,可以看到命令行程序和SWT程序同样可以享受到JAVA6带来的Splash
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值