final ProgressHandle ph = ProgressHandleFactory.createHandle("Minifying JS , CSS and other WEB Content ", theTask);
theTask.addTaskListener(new TaskListener() {
@Override
public void taskFinished(org.openide.util.Task task) {
//JOptionPane.showMessageDialog(null, "Image Compressed Successfully");
ph.finish();
}
});
ph.start();
theTask.schedule(0);
}