This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
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

Win a copy of Head First Android this week in the Android forum!
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

doubts with code and codebase in the applet tag

suppi venkat

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




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




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.

Joe Ess

Joined: Oct 29, 2001
Posts: 9125

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]
I agree. Here's the link:
subject: doubts with code and codebase in the applet tag
It's not a secret anymore!