This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

image - java.awt.Frame  RSS feed

 
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: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing/AWT forum.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!