Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Toolkit.getImage()  RSS feed

 
Sanjay Daga
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to run the following code on the Red Hat Linux machine 7.3
Toolkit tk = Toolkit.getDefaultToolkit();
Image backimage = tk.getImage("/home/web1/html/image/image_name.jpg");
MediaTracker mediaTracker = new MediaTracker(new Frame());
mediaTracker.addImage(backimage, 0);
mediaTracker.waitForID(0);
I am getting Error:null message, I set the Dispaly property of the system.
Can anybody help me with that.
Thanks
Sanjay
 
indian greenhorn
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
Do check the image file path and check whether it is in correct folder.
Krishna
 
basha khan
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this
Image backimage = tk.getImage("./home/web1/html/image/image_name.jpg");
put a dot before first '/' in the path.fixed??
basha
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!