• Post Reply Bookmark Topic Watch Topic
  • New Topic

Load image in an Applet

 
Titus Abraham
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).
 
Steve Jefferson
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.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • 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.
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!