eclipse RCP进度条显示
public class ProcessControl { public static void execute(final String filepath) { ProgressMonitorDialog progress = new ProgressMonitorDialog(null); try { progress.run(true, false, new IRunnableWithProgress() { public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { monitor.beginTask("正在转换文件", IProgressMonitor.UNKNOWN); monitor.setTaskName("转换文件"); //执行程序 String s = filepath;
//程序结束 for(int i=0;i<1000000;i++){ System.out.println(s+"1"); } monitor.done(); } }); } catch (InvocationTargetException e) { e.printStackTrace(); } catch (InterruptedException e) { e.printStackTrace(); } } }