The Goal
          Keep walking……
          posts - 23,  comments - 1,  trackbacks - 0
          ProgressBar,進度條,是ProgressIndicator的簡化版本。大多數情況下推薦使用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

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 海阳市| 临清市| 濮阳县| 平乐县| 张掖市| 永嘉县| 西和县| 黑山县| 江津市| 孝感市| 普定县| 民勤县| 岳普湖县| 石楼县| 句容市| 建宁县| 长兴县| 青阳县| 勃利县| 吉安县| 漠河县| 宁蒗| 昌都县| 桂东县| 安平县| 宁强县| 钦州市| 乌拉特中旗| 南康市| 长武县| 高邮市| 德格县| 琼中| 通许县| 格尔木市| 苏尼特左旗| 武冈市| 安龙县| 理塘县| 同德县| 宜兰县|