Solved

How to call another class in applet?

Posted on 2004-08-18
2
388 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
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 50 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
split53 challenge 7 77
Eclipse Neon and jdk 1.8.0 11 126
JDeveloper 12c for 32 bit 4 68
Java passing arguments (type error) 2 48
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
This video teaches viewers about errors in exception handling.

919 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now