销毁的逻辑没有怎么实现-自己捕获异常做相关处理就OK了
/**
* @Title: Test.java
* @Description: TODO
* @author zouxs
* @date 2012-9-25
*/
public class ProgressBarTest {
public void show_ProgressBar(Composite parent) {
ProgressBar hBar1 = new ProgressBar(parent, SWT.HORIZONTAL
| SWT.INDETERMINATE);
hBar1.setMinimum(0);
hBar1.setMaximum(100);
(new IncresingOperator(hBar1)).start();
}
class IncresingOperator extends Thread {
private ProgressBar bar;
IncresingOperator(ProgressBar bar) {
this.bar = bar;
}
public void run() {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
if (bar.isDisposed())
return;
for (int i = 0; i < bar.getMaximum(); i++) {
System.out.pr