0

I am new to Applets, and have the following basic Applet, which works fine in Eclipse.

import java.applet.*; 
import java.awt.Graphics;

public class Sound extends Applet
{ 

    public void paint(Graphics g){
        super.paint(g);
        g.drawString("MESSAGE", 100, 100);
    }

}

I am using the following to include it in my HTML:

<APPLET ARCHIVE="file:C:\Projects\Dresscode\www\Dresscode\SoundApplet.jar" CODE="Sound.java" width="300" height="500">

I am getting a:

Security Exception, Permission Denied Error

I have read about self-signing, the manifest and many other possible reasons for this error, but have not been able to accurately diagnose the problem.

The applet is not requesting any reads or writes so should not require high security?

From my understanding Applets are commonly used on web pages, so why am I having such problems and such difficulty diagnosing the problem-I would expect it to be a reasonably simple fix. And can anyone suggest a solution to me?

Alex
  • 3,730
  • 9
  • 43
  • 94
  • *"From my understanding Applets are commonly used on web pages, so why am I having such problems and such difficulty diagnosing the problem"* Because applets are a PITA. Always have been, and even more so after last years security updates. 1) Why code an applet? If it is due to the teacher specifying it, please refer them to [Why CS teachers should **stop** teaching Java applets](http://programmers.blogoverflow.com/2013/05/why-cs-teachers-should-stop-teaching-java-applets/). .. – Andrew Thompson Jan 13 '15 at 00:44
  • .. 2) Why use AWT? See [this answer](http://stackoverflow.com/questions/6255106/java-gui-listeners-without-awt/6255978#6255978) for many good reasons to abandon AWT using components in favor of Swing. 3) Be sure the [Java Console](http://www.java.com/en/download/help/javaconsole.xml) is configured to show. If there is no output at the default level, raise the level and try it again. – Andrew Thompson Jan 13 '15 at 00:44

0 Answers0