This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to get an image add on Panel ?

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,
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
For my next feat, I will require a volunteer from the audience! Perhaps this tiny ad?
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic