/Users/lyon/j4p/src/gui/browser/ThreadedLoad.java

1    package gui.browser; 
2     
3    import javax.swing.*; 
4    import java.net.URL; 
5     
6    /** 
7     * Thread is set to gui.run in the lowest priority class. 
8     */ 
9     
10    
11   public class ThreadedLoad implements Runnable { 
12       Thread t = new Thread(this); 
13       URL u; 
14       JEditorPane jep; 
15    
16       public ThreadedLoad( 
17               JEditorPane _jep, URL _u) { 
18           t.setPriority(Thread.MIN_PRIORITY); 
19           t.setDaemon(true); 
20           u = _u; 
21           jep = _jep; 
22           t.start(); 
23       } 
24    
25       /** 
26        * 
27        * External Thread 
28        * 
29        */ 
30    
31       public void setPriority(int i) { 
32           t.setPriority(i); 
33       } 
34    
35       public void setDaemon(boolean b) { 
36           t.setDaemon(b); 
37       } 
38    
39    
40       public void run() { 
41           try { 
42               jep.setPage(u); 
43           } catch (Throwable t) { 
44               System.out.println("could not open:" + u); 
45           } 
46       } 
47   } 
48