• Post Reply Bookmark Topic Watch Topic
  • New Topic

image - java.awt.Frame

 
Sofie Deceuninck
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • 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!
 
Tanveer Rameez
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • 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 ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT forum.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!