Hello,
I am testing the following applet on my webpage:
import javax.swing.*;
public class Hello extends JApplet
{
public void init()
{
JOptionPane.showMessageDialog (null, "Hello World");
}
}
My Hello.html file from BlueJ:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This file automatically generated by BlueJ Java Development -->
<!-- Environment. It is regenerated automatically each time the -->
<!-- applet is run. Any manual changes made to file will be lost -->
<!-- when the applet is next run inside BlueJ. Save into a -->
<!-- directory outside of the package directory if you want to -->
<!-- preserve this file. -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Hello Applet</title>
</head>
<body>
<h1>Hello Applet</h1>
<hr>
<applet code="Hello.class"
width=500
height=500
codebase="."
archive="Hello.jar"
alt="Your browser understands the <APPLET> tag but isn't running the applet, for some reason."
>
Your browser is ignoring the <APPLET> tag!
</applet>
<hr>
</body>
</html>
The "Hello.html", "Hello.jar" and "Hello.class files" are inside the public_html folder of my webpage.
When I run the program in IE (10.0.9), a java command line appears and the "Java symbol" appears and runs for a while with no output and finally an exception of "Hello.class not found" is shown (even though Hello.class is inside the public_html folder).
I can run the program using "appletviewer Hello.html"in the command line.
I would be grateful for any help.
Thank you~