wood burning stoves 2.0*
The moose likes Applets and the fly likes doubts with  code and codebase in the applet tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "doubts with  code and codebase in the applet tag" Watch "doubts with  code and codebase in the applet tag" New topic
Author

doubts with code and codebase in the applet tag

suppi venkat
Greenhorn

Joined: Oct 26, 2004
Posts: 2
The name of my html file is download.html.It is in the E:\Click_Eat folder.
I have the html file calling the applet Download.The applet'Download' is in the C:\ecllipse\ folder, . class file of the applet is in C:\Supjava\EcllipseProjects\SwingTest.My applet 'Download ' is in the package SwingTest.
iam using

<html>
<head>
<title>DOWNLOADING FROM SUN.COM</title>
</head>

<body>

<APPLET

CODE ="SwingTest\Download.class" CODEBASE="SwingTest" WIDTH=200 HEIGHT=200 >


</APPLET>

</body>

</html>

this works.

1)note the code and the codebase values.Here iam not specifying the entire path of the .class file of the applet in the code base which is present in a different path compared to where my html is stored.

2)Iam using the package name in the code value
ie code=SwingTest/Download.class.If i just use
code=Download.class it gives me an error java.lang.NoClassDefFoundError: Download (wrong name: SwingTest/Download)
please explain why ? and what values should i put for code and codebase.

thankyou
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8964
    
    9

The path in the CODEBASE parameter is relative to the directory where the HTML is located. Take a look at Using the APPLET tag for more info.


[How To Ask Questions On JavaRanch]
 
Consider Paul's rocket mass heater.
 
subject: doubts with code and codebase in the applet tag