perhaps the error is in the line ofToolkit.To avoid why not use simple syntaximage = getImage(getDocumentBase(),"1.gif");image = getImage(getCodeBase(),"1.gif");