此代码用于从gmail服务器检索邮件,它仅工作一分钟然后停止原因?
ActionListener displayNotification = new ActionListener() {
int oldn=0, newn=0;Folder f = s.getmailFolder();
public void actionPerformed(ActionEvent ae) {
try{
f=s.getmailFolder();
newn=f.getUnreadMessageCount();
}catch(Exception e){}
if (oldn!=newn)
s.getNotification(f);
oldn=newn;
}
};
Timer t = new Timer (10000,displayNotification);
t.start();