Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to load image into my applet  RSS feed

 
Terry Stehle
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • 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
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!