File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: access denied
( images/new.gif read)
at Source)
at 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(
at interpA.<init>(
at interp.init(
at Source)
at Source)
who can i get around this problem ?

Alexandre S. Melo
ashish kulkarni
Ranch Hand

Joined: Aug 15, 2002
Posts: 130
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 agree. Here's the link:
subject: Buttons with imagens in applet from server
Similar Threads
Applet problems
Security Exception for showing images
AccessControlException and DefClassNotFound
Unable to show icons in toolbar in the applet
custom classloader in applet