1 package org.lucane.applications.jmail.base; 2 3 22 23 import javax.mail.*; 24 25 27 final class FolderListener extends Thread 28 { 29 30 private MainPanel panel; 31 private int refreshInterval; 32 33 36 protected FolderListener(Profile profile, MainPanel panel) 37 { 38 this.panel = panel; 39 this.refreshInterval = profile.getRefreshInterval(); 40 } 41 42 43 public final void run() 44 { 45 Folder f = null; 46 47 try 48 { 49 while(true) 50 { 51 Thread.sleep(refreshInterval); 52 53 f = panel.getCurrentFolder(); 54 55 if(f != null) 56 if(f.isOpen()) 57 f.getMessageCount(); 58 } 59 } 60 61 catch(Exception e) 62 { 63 e.printStackTrace(); 64 } 65 } 66 } 67 | Popular Tags |