IntelliJ Java IDE
The moose likes Swing / AWT / SWT / JFace and the fly likes How to load image into my applet Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "How to load image into my applet" Watch "How to load image into my applet" New topic
Author

How to load image into my applet

Terry Stehle
Greenhorn

Joined: Mar 24, 2001
Posts: 24
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

Joined: Oct 18, 2000
Posts: 4120

Don't use the Toolkit to get an image in an applet... use the getImage(url, string) method of applet...

-Nate


-Nate
Write once, run anywhere, because there's nowhere to hide! - /. A.C.
 
 
subject: How to load image into my applet
 
Threads others viewed
Extending BufferedImage
Memory Leak
Applet, How to get the image displayed PLEASE HELP
Servlet returns snippet but image does not appear when run on cell phone
Applet, How to get the image displayed PLEASE HELP
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture