• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

image - java.awt.Frame

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to display an image in a frame but my image isn't displayed. I know this has been discussed already but it stil wasn't clear to me.
Thanks!
 
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
[/qb]<hr></blockquote>
Use java.awt.MediaTracker to wait till the complete image is laoded :
img = Toolkit.getDefaultToolkit().getImage("kerst.jpg");
MediaTracker mt=new MediaTracker(this);
mt.addImage(img,0);
mt.waitForID(0);
setSize(500,500);
setVisible(true);
That should solve your problem.
Tanveer
[ February 20, 2004: Message edited by: Tanveer Rameez ]
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to Swing/AWT forum.
 
reply
    Bookmark Topic Watch Topic
  • New Topic