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

          交友莫獨酒,茅臺西鳳游。
          口干古井貢,心徜洋河流。
          稱多情杜康,趟無量雙溝。
          贊中華巍巍,無此不銷愁。

          常用鏈接

          留言簿(68)

          隨筆分類(136)

          隨筆檔案(122)

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 526712
          • 排名 - 92

          最新評論

          ?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 交口稱贊 閱讀(1202) 評論(1)  編輯  收藏 所屬分類: Java6

          FeedBack:
          # re: 學習Java6(八)Splash(4)Splash其它 2007-04-18 08:42 開源英漢機器翻譯
          開源英漢機器翻譯.

          開源英漢機器翻譯C#.NET項目 www.liebiao.net

          我們邀請你 技術交流  回復  更多評論
            
          主站蜘蛛池模板: 垦利县| 大埔区| 南涧| 柞水县| 瑞金市| 镶黄旗| 科技| 佛冈县| 奉化市| 邮箱| 红安县| 宿迁市| 东乡县| 施甸县| 全椒县| 镇赉县| 平山县| 额尔古纳市| 尚义县| 长丰县| 河北区| 东乌| 东乡族自治县| 宜阳县| 朝阳区| 鹿邑县| 西城区| 项城市| 西吉县| 新兴县| 隆林| 廉江市| 卓尼县| 衡阳县| 天长市| 阳春市| 广安市| 江华| 兴海县| 称多县| 元谋县|