The Goal
          Keep walking……
          posts - 23,  comments - 1,  trackbacks - 0
          ProgressBar,進度條,是ProgressIndicator的簡化版本。大多數(shù)情況下推薦使用ProgressIndicator。如果你決定直接使用ProgressBar,需要手動改變此bar的外觀。如下

          //Style can be SMOOTH, HORIZONTAL, or VERTICAL
          ProgressBar bar = new ProgressBar(parent, SWT.SMOOTH);
          bar.setBounds(10, 10, 200, 32);
          bar.setMaximum(100);
          ...
          for(int i = 0; i < 10; i++) {
          //Take care to only update the display from its
          //own thread
          Display.getCurrent().asyncExec(new Runnable() {
          public void run() {
          //Update how much of the bar should be filled in
          bar.setSelection((int)(bar.getMaximum() * (i+1) / 10));
          }
          });
          }

          setSelection()causes the widget to be updated every time.This behavior is unlike that of ProgressIndicator or ProgressMonitorDialog,which will update the display only if it has changed by an amount that will be visible to the end user.
          posted on 2006-04-10 17:56 JOO 閱讀(417) 評論(0)  編輯  收藏 所屬分類: SWT & JFace IN ACTION
          Hit the target!

          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(2)

          隨筆分類(23)

          隨筆檔案(22)

          文章檔案(1)

          相冊

          Neighbor

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 大田县| 柳江县| 沙田区| 平原县| 永吉县| 南丹县| 舒兰市| 泾阳县| 延吉市| 敦煌市| 云和县| 从江县| 尚义县| 运城市| 镇平县| 黄浦区| 大荔县| 手机| 鸡西市| 牟定县| 建平县| 都匀市| 定西市| 丽江市| 嘉禾县| 昭平县| 上杭县| 鄂伦春自治旗| 赤峰市| 探索| 荣昌县| 乌拉特后旗| 梨树县| 阳东县| 阿合奇县| 成都市| 元江| 安仁县| 嘉黎县| 柯坪县| 阿尔山市|