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

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

          常用鏈接

          留言簿(68)

          隨筆分類(136)

          隨筆檔案(122)

          最新隨筆

          搜索

          •  

          積分與排名

          • 積分 - 526770
          • 排名 - 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 交口稱贊 閱讀(1203) 評論(1)  編輯  收藏 所屬分類: Java6

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

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

          我們邀請你 技術(shù)交流  回復(fù)  更多評論
            
          主站蜘蛛池模板: 青岛市| 大方县| 凌海市| 神木县| 靖西县| 抚宁县| 黔江区| 资源县| 石泉县| 历史| 淳安县| 中江县| 鄂州市| 彝良县| 千阳县| 武胜县| 桐柏县| 武宁县| 虹口区| 巴楚县| 革吉县| 湖北省| 嘉定区| 庄浪县| 吴川市| 兰西县| 南江县| 绍兴市| 全州县| 闽侯县| 定边县| 安国市| 义马市| 凤庆县| 奇台县| 巴彦淖尔市| 宿迁市| 上犹县| 内乡县| 原阳县| 浦江县|