i have made a HelloWorld applet(running in appletviewer in EclipseIDE) , now i just wanted to run it from my browser but it is not running.
code as follows.
package com.bhaveshjava.trial;
import java.awt.Graphics;
public class HelloWorld extends java.applet.Applet {
public void init() {
resize(250,250);
}
public void paint(Graphics g) {
g.drawString("Hello world!", 150, 100);
}
}
and htmlfile
<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE="com.bhaveshjava.trial.HelloWorld" codebase="./bin" WIDTH=150 HEIGHT=255>
</APPLET>
</BODY>
</HTML>
further both the HelloWorld.class and Hello.html are in the same folder, still in browser it is showing the "Here is the output of my program:" after that an error
message.
Details of error message are provided
Java Plug-in 1.6.0_35
Using JRE version 1.6.0_35-b10 Java HotSpot(TM) Client VM
User home directory = C:\Users\bhavesh
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
load: class com.bhaveshjava.trial.HelloWorld not found.
java.lang.ClassNotFoundException: com.bhaveshjava.trial.HelloWorld
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(U nknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Un known Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager.createApplet(Unk nown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionR unnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Exception: java.lang.ClassNotFoundException: com.bhaveshjava.trial.HelloWorld