This discussion is archived
3 Replies Latest reply: Jun 19, 2013 1:18 PM by rp0428 RSS

Problems with applet "Hello World"

6f6281a0-69b9-4167-af47-e84d9f2cb14b Newbie
Currently Being Moderated

I'm trying to get an applet to work but i get this error in eclipse : JAR export finished with warnings. See details for additional information.
  Exported with compile warnings: HelloWorldWeb/src/HelloWorldWeb.java.

 

The jar file exported but does not seem to work.  When I open the html file to load the applet I get a noclassdef error.  Here is the code.  All files are in the same folder.

 

{code}

 

import acm.graphics.*;
import acm.program.*;

 

public class HelloWorldWeb extends GraphicsProgram{
    public void run(){
        add(new GLabel("hello, world"), 20, 20);
    }

 

}

//HTML

{code}

<html>
    <title>Hello World</title>
    <applet archive = "HelloWorldWeb.jar"
            code = "HelloWorldWeb.class"
            width = 300 height = 150>
    </applet>
</html>

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points