Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Toolkit.getImage()

 
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
 
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
 
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
reply
    Bookmark Topic Watch Topic
  • New Topic