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 to get an image add on Panel ?

 
Sam Cala
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
I know its a basic question but still I'm stucked up. I have to add up an image on the panel and then the panel on the applet. Like in applet, we have a method called - getImage(URL r,String name) which returns Image object but I dont know which method is there in Panel to acquire Image instance ?
Tell me how to get an image added on the panel.
Regards and thanks,
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sam,
You would get the image with the applet and then pass it to the Panel. To make the panel draw it you could do several things... one of which is to extend panel to make it draw the image.

Then use your new ImagePanel in an Applet :

This is a pretty simple example ( and there are other ways of getting the same result ) but hopefully this is useful to you.
HTH,
-Nate
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic