This is what Benoit Moussaud  had to say on precisely this issue:

In order to use TExtPaneAppender with JavaWebStart, 
I have modified this file, in particular the loadIcon method,

public /*static*/ Image loadIcon ( String path ) { 
  Image img = null; 
  try { 
    ClassLoader classload = this.getClass().getClassLoader(); 
    URL url = classload.getResource(path); 
    img = (Image) (Toolkit.getDefaultToolkit()).getImage(url); 
  } catch (Exception e) { 
    System.out.println("Exception occured: " + e.getMessage() + " - " + e ); 
  } 
  return (img); 
}

I have following JavaWebStart developper guide to load the resource
Retrieving Resources from JAR files  

Java Web Start only transfers JAR files from the Web server to the client 
machine. It determines where to store the JAR files on the local machine. 
Thus, an application cannot use disk-relative references to resources such 
as images and configuration files. 
All application resources must be retrieved from the JAR files specified in 
the resources section of the JNLP file, or retrieved explicitly using an 
HTTP request to the Web server. We recommend storing resources in JAR files, 
since they will be cached on the local machine by Java Web Start. 
The following code example shows how to retrieve images from a JAR file: 
// Get current classloader 
ClassLoader cl = this.getClass().getClassLoader(); 
// Create icons 
Icon saveIcon = new ImageIcon(cl.getResource("images/save.gif")); 
Icon cutIcon = new ImageIcon(cl.getResource("images/cut.gif")); 

---------------------------------------------------------------------------- 
Benoit Moussaud - [EMAIL PROTECTED] 
CTS - Cril Telecom Software 
http://www.criltelecom.com 
8 rue danjou 
92517 Boulogne Billancourt - France 
Tel: 01 58 17 04 78



At 10:17 15.02.2001 -0500, you wrote:

>I want to use the GUI TextPaneAppender to look at the log files, but I am
>encountering
>errors when it tries to load the icons, specifically, the error happens at
>
>log4j:ERROR Could not create an Appender. Reported error follows.
>java.lang.NullPointerException
>        at javax.swing.ImageIcon.<init>(Unknown Source)
>        at
>org.apache.log4j.gui.TextPaneAppender.createIcons(TextPaneAppender.java:133)
>
>Any ideas?
>
>Leon

----
Ceki Gülcü           e-mail: [EMAIL PROTECTED] (preferred)
av. de Rumine 5              [EMAIL PROTECTED]
CH-1005 Lausanne          
Switzerland            Tel: ++41 21 351 23 15


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to