Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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 Murach's Java Servlets and JSP this week in the Servlets 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
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: 8836
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: doubts with code and codebase in the applet tag
 
Similar Threads
Problem loading applet from servlet - load: xxx.class not found
can't able to get applet in browser
Problems while Loading Applet...
Applet .....need help to run the applet
Unable to load applet in web browser.