SWT应用程序窗口程序(time 类):
import java.util.Timer;import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;public class time {
public static void main(String[] args) {
try {
time window = new time();
window.open();
} catch (Exception e) {
e.printStackTrace();
}
} public void open() {
final Display display = Display.getDefault();
final Shell shell = new Shell();
shell.setSize(500, 375);
shell.setText("SWT Application");

Timer t=new Timer();
timertask tt=new timertask(this);
t.schedule(tt, 1000);

shell.open();
shell.layout();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
}
}
继承TimerTask类的程序(timertask类):
import java.util.Calendar;
import java.util.TimerTask;import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.widgets.Display;
public class timertask extends TimerTask{
    time t;
    
    public timertask(time t){
     this.t=t;
    }
    
    
public void run() {
set();
}

public void set(){
Display.getDefault().syncExec(new Runnable(){
public void run() {
MessageDialog.openInformation(null,"asd","adsf");
}

});
}}
程序的问题是:当我关闭SWT应用程序窗口的时候,还有进程在运行,我必须手动关闭,请问我写的程序那又问题!