• Post Reply Bookmark Topic Watch Topic
  • New Topic

Checking Loading of image  RSS feed

 
kirba devi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


Image img=Toolkit.getDefaultToolkit().getImage("D:/Images/sd.img");
Image img1=Toolkit.getDefaultToolkit().getImage("D:/Images/sd1.img");
Image img2=Toolkit.getDefaultToolkit().getImage("D:/Images/sd2.img");
MediaTracker track=new MediaTracker();
track.addImage(img);
track.addImage(img1);
track.addImage(img2);
try
{
track.waitForID(img);
track.waitForID(img1);
track.waitForID(img2);
}catch(Exception e){}

Loaded images using Mediatracker(java.awt.MediaTracker)

For checking whether the image are loaded i have used ie for eg: track.checkID(img)

is there any other to check whether image(particular image say img,img1) are loaded apart
from track.checkID(Id),track.checkID(id,true/false).

Regards
Kirba.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!