• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

images not loaded.........

 
atif dar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am accessing the applet resieding on the linux server...i am accessing mysql database as well...what is happening is that every things loads properly except for the image.....i have tried to change the extensions from Gif to png and jpg but nothing seems to work...how can i load these images....because on my local computer running windows every thing works fine...
 
Joe Ess
Bartender
Posts: 9340
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using Applet.loadImage() to get the gif? According to the documentation for java.applet.Applet:
This method always returns immediately, whether or not the image exists. When this applet attempts to draw the image on the screen, the data will be loaded

So the image data is probably not being loaded before you try to display it. You need to use a java.awt.MediaTracker to insure that the image is completely loaded.
 
atif dar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am simply using this

URL url=getCodeBase();
im=getImage(url,"1.gif");

and than in paint

g.drawImage(im,0,0,this);

and on windows platform it works really well but when i try to load it from linux it doesn't work...anyway i will try out media tracker thanks for advice
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic