• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How to load image into my applet

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have create an applet that launches a Frame and have not had a problem until I tried to add images to it. The images are on my web site, and I get a message excess denied. This is how part of the code looks
private Image myImage;//Defined before the constructor of my class
Toolkit kit = getDefaultToolkit();
myImage = kit.getImage("mywebaddress/filename");
The code is just an exsample. I have not problem running the program on my computer using the appletviewer but as soon as I try to bring it up in the browser, or place it on the web I get the error message. If I cannot use the Toolkit to grab the image, please let me know how. By the way parts of my image are transparent. So I need to keep the transparent parts transparent. I would appricate any help thanks Terry
 
Bartender
Posts: 4121
IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't use the Toolkit to get an image in an applet... use the getImage(url, string) method of applet...

-Nate
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic