Solved

How to call another class in applet?

Posted on 2004-08-18
2
387 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
Comment Utility
add the jars to the archive parameter of your applet tag.
0
 
LVL 7

Accepted Solution

by:
JugglerW earned 50 total points
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
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…

743 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

17 Experts available now in Live!

Get 1:1 Help Now