Ok guys, I am
getting the following error when I try to run this applet through the web. It
works fine if I run it from dos prompt or my local drive as an
applet.
Link to my site is http://www.geocities.com/ahmedbinshakil/Kawa/album.html
Uncaught error fetching image:
java.lang.NullPointerException
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
at
sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
Source)
at
sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown
Source)
at
sun.plugin.protocol.jdk12.http.HttpURLConnection.checkCookieHeader(Unknown
Source)
at
sun.plugin.protocol.jdk12.http.HttpURLConnection.getInputStream(Unknown
Source)
at
sun.awt.image.URLImageSource.getDecoder(Unknown Source)
at
sun.awt.image.InputStreamImageSource.doFetch(Unknown Source)
at sun.awt.image.ImageFetcher.fetchloop(Unknown
Source)
at sun.awt.image.ImageFetcher.run(Unknown
Source)
and my code looks
like this: -
final String texFile = "./floor1.jpg";
TextureLoader loader = null;
if (m_bApplet) {
try {
loader = new TextureLoader( new URL(getCodeBase(), texFile), this);
}
catch (MalformedURLException e) {
m_acontext.showStatus("texture image not found");
e.printStackTrace();
}
}
else
loader = new TextureLoader( texFile, this );
Appearance app = new
Appearance();
TextureLoader loader = null;
if (m_bApplet) {
try {
loader = new TextureLoader( new URL(getCodeBase(), texFile), this);
}
catch (MalformedURLException e) {
m_acontext.showStatus("texture image not found");
e.printStackTrace();
}
}
else
loader = new TextureLoader( texFile, this );
if ( loader!=null )
app.setTexture(loader.getTexture());
any
ideas???
Ahmed
