Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I put an image on a AWT Component?

 
m.l. marcoernandes
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
While on Swing I use the ImageIcon interface, how can I do the same whith AWT... Applets Swing are not Standard yet.
Thanks
 
Daniel Searson
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can load in a java.awt.Image using the getImage() method in Applet. Then just override the AWT component's paint() method and draw the Image there with Graphics.drawImage(). The only problem with this is that images will not cooperate with any text on the component (they'll just sit behind it I think) so you might have to write your own methods to do this.
Daniel
[This message has been edited by Daniel Searson (edited May 24, 2001).]
 
Raajesh Chandran
Ranch Hand
Posts: 103
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ya! I accept Daniel Post.U must have to write U'r Own methods to do this.

chandran..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic