• 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Load image in an Applet

 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,

I am not sure where i am making the mistake.

JLabel contactImage =new JLabel();
contactImage.setIcon(new ImageIcon('cathy.GIF'));
i am adding this label to a panel and that is being added to a JList which is being displayed in an applet.

though this works fine on desktop applications it doesn't work for applet.

i have tried putting all resources in a jar file and signing it but the image doesn't load. JVM console doesnt give me any error too.
my html code for the same is
<APPLET CODE="YagattaApplet.class"
archive="my.jar"
WIDTH=210 HEIGHT=435>
</applet>

where my is having the GIF files

Can you tell me whats wrong ?

Best regards,
Titus
 
Titus Abraham
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It ok.. i didnt use class loader to load the resource ( i was using relative path earlier).
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before you post any thread please be sure you don't have solution for that and ask others.
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Before you post any thread please be sure you don't have solution for that and ask others.


From the time lapse between Titus' first and second post it seems obvious that he did NOT have the solution when he started this topic.
 
Titus Abraham
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Sherrif. I am new to the language and This site has really helped me to overcome hurdles.
 
She'll be back. I'm just gonna wait here. With this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic