hengheng123456789

            BlogJava :: 首頁 :: 聯系 :: 聚合  :: 管理
            297 Posts :: 68 Stories :: 144 Comments :: 0 Trackbacks
          1、顯示一個簡單的保存對話框。
          ?public static void main (String [] args) {
          ??Display display = new Display ();
          ??Shell shell = new Shell (display);
          ??shell.open ();
          ??FileDialog dialog = new FileDialog (shell, SWT.SAVE);
          ??dialog.setFilterNames (new String [] {"Batch Files", "All Files (*.*)"});
          ??dialog.setFilterExtensions (new String [] {"*.bat", "*.*"}); //Windows wild cards
          ??dialog.setFilterPath ("c:\\"); //Windows path
          ??dialog.setFileName ("fred.bat");
          ??System.out.println ("Save to: " + dialog.open ()); //打開對話框
          ??while (!shell.isDisposed ()) {
          ???if (!display.readAndDispatch ()) display.sleep ();
          ??}
          ??display.dispose ();
          ?}
          posted on 2006-11-07 15:11 哼哼 閱讀(7722) 評論(0)  編輯  收藏 所屬分類: SWT
          主站蜘蛛池模板: 桐庐县| 凤台县| 三江| 陇西县| 盈江县| 晋城| 孝昌县| 德昌县| 庄河市| 扎赉特旗| 乐至县| 遂宁市| 水富县| 高要市| 濮阳县| 天长市| 滁州市| 安图县| 门头沟区| 延长县| 连州市| 锦州市| 延安市| 鸡东县| 商洛市| 农安县| 盐源县| 迁西县| 永川市| 闽清县| 平塘县| 和林格尔县| 金川县| 子长县| 乌恰县| 繁昌县| 调兵山市| 湘乡市| 安宁市| 黑水县| 株洲市|