Results 1 to 2 of 2
Thread: Help with a tutorial applet
- 03-14-2010, 06:39 PM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Help with a tutorial applet
My friend is helping me learn Java Applets, and showed me a link to his site here:
Applet Demo
I am using the source as a .java written with Notepad, with the same name as the class. then I make a .HTML based on the Source Code of the page. However, when I open the .HTML, it says "error: click for details" where the Applet should be. I click it, and it says this:
Java Plug-in 1.6.0_18
Using JRE version 1.6.0_18-b07 Java HotSpot(TM) Client VM
User home directory = C:\Documents and Settings\Gio
----------------------------------------------------
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 AppletDemo not found.
java.lang.ClassNotFoundException: AppletDemo
at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
at java.lang.ClassLoader.loadClass(Unknown 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)
Caused by: java.io.FileNotFoundException: C:\Documents and Settings\Gio\My Documents\Java Programs\Tests\AppletDemo.class (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at sun.net.http://www.protocol.file.FileURLConn...onnect(Unknown Source)
at sun.net.http://www.protocol.file.FileURLConn...Stream(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
at java.security.AccessController.doPrivileged(Native Method)
... 7 more
Exception: java.lang.ClassNotFoundException: AppletDemo
if anyone can help me, it would be greatly appriceated. I am learning how to write Applets and do not know alot about it.
- 03-14-2010, 08:59 PM #2
Senior Member
- Join Date
- Dec 2009
- Location
- Belgrade, Serbia
- Posts
- 364
- Rep Power
- 4
When you write source code file extension is like MyApplet.java.
You have to compile your source file. Use some java tool.
Then you get class file like MyApplet.class
You have to use *.class files and not *.java files with your html files.
Be sure html and *.class are in same folder !
When you write html and you use applet tag like this (.class mat be omitted)
<applet code = "MyApplet.class"
height = "150"
width = "300" >
</applet>
better now?
Use official tutorial for learning :
Lesson: Applets (The Java™ Tutorials > Deployment)
Similar Threads
-
Need help with my tutorial
By annna in forum New To JavaReplies: 2Last Post: 02-05-2010, 03:00 PM -
Tutorial help LAST QNS
By annna in forum New To JavaReplies: 2Last Post: 01-28-2010, 12:22 PM -
web tutorial
By poobeer in forum Web FrameworksReplies: 1Last Post: 10-24-2009, 02:10 AM -
ejb tutorial
By marcellis in forum Enterprise JavaBeans (EJB)Replies: 3Last Post: 09-30-2009, 01:43 PM -
Applet Login System Tutorial
By Free-JavaTutorials in forum Java AppletsReplies: 0Last Post: 03-15-2008, 02:51 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks