wood burning stoves
The moose likes Applets and the fly likes Buttons with imagens in applet from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Applets
Bookmark "Buttons with imagens in applet from server" Watch "Buttons with imagens in applet from server" New topic

Buttons with imagens in applet from server

Alexandre Melo

Joined: Oct 03, 2002
Posts: 1
i've an applet that have any buttons with image in your label.
like> button1.setIcon(new ImageIcon("images/cut.gif"));
but see that applet don't have permition to load it.
the error:
java.security.AccessControlException: access denied
(java.io.FilePermission images/new.gif read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at sun.awt.SunToolkit.getImageFromHash(Unknown Source)
at sun.awt.SunToolkit.getImage(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at javax.swing.ImageIcon.<init>(Unknown Source)
at interpA.createMenus(interpA.java:178)
at interpA.<init>(interpA.java:42)
at interp.init(interp.java:41)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
who can i get around this problem ?

Alexandre S. Melo
ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 131
u cannot load the image directly do the following in your applet
Image img =
getImage(getCodeBase(), "images/cut.gif");
and then use this image to your button
hope this helps

Rob Ross

Joined: Jan 07, 2002
Posts: 2205
Please change your name to comply with the naming policy to which you agreed when you registered here..

For your publicly displayed name,
use a first name, a space, and a last name.

You can change your name

You can also find the naming policy
Thank You!

SCJP 1.4
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: Buttons with imagens in applet from server
It's not a secret anymore!