?
Solved

How to call another class in applet?

Posted on 2004-08-18
2
Medium Priority
?
399 Views
Last Modified: 2006-11-17
Hello,
I have an applet A, inwhich I want to use another classes B and C which are defined in another package.
In fact, I already compressed B and C into D.jar file, and copy D.jar into the same directory with the applet A.
But when I run applet A (in browser), it appear an error:
java.lang.NoClassDefFoundError: B
Please show me how to solve this problem in urgen
Thanks a lot
0
Comment
Question by:ndhai
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 92

Expert Comment

by:objects
ID: 11828054
add the jars to the archive parameter of your applet tag.
0
 
LVL 7

Accepted Solution

by:
JugglerW earned 150 total points
ID: 11828482
Your applet tag should looks like:

                                                       <applet
                                                                code="A.class"
                                                                width="www"
                                                                height="hhh"
                                                                archive="D.jar"
                                                        >
                                                                <!-- If you want support MS VM in IE  you also have to create a CAB file (use cabarc.exe) -->
                                                                <param name="cabbase"            value="D.cab">
                                                        </applet>
   
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question