0

I have the following code:

@SuppressWarnings("serial") 
public class AppletImage extends Applet {   
 Image picture;

 public void init() {       
   picture = getImage(getDocumentBase(), "slider_front_img.png");
 }
 public void paint(Graphics g) {        
   g.drawImage(picture, 10, 10, this);  
 } 
}

And I want to call it on html5 page which as the following code so far:

<!DOCTYPE html>
<html>
<head>
<meta charset="US-ASCII">
<title>Insert title here</title>
</head>
<body>
    <script src="http://www.java.com/js/deployJava.js"></script>
    <script>
        var attributes = {
            codebase : 'ProjetoICD',
            code : 'AppletImage.class',
            archive : 'Java2Demo.jar',
            width : 710,
            height : 540
        };
        var parameters = {
            fontSize : 16
        };
        var version = '1.7';
        deployJava.runApplet(attributes, parameters, version);
    </script>

</body>
</html>

When I run it on Firefox it launches an application error saying "class not found exception". I can't find which packages may be wrong.

Code structure on eclipse

Siguza
  • 21,155
  • 6
  • 52
  • 89
Alexandra
  • 35
  • 1
  • 1
  • 6
  • Your attributes variable doesn't mention packages at all. – nitind Jul 18 '15 at 17:49
  • 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/). 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. ... – Andrew Thompson Jul 19 '15 at 08:33
  • ... 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 Jul 19 '15 at 08:33

0 Answers0