Solved

How to call another class in applet?

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Java SE 8u111  Lot of stuff broke 11 69
Opening PDF on button click and fill new document 2 39
hibernate jars 4 32
Is there a simpler dropbox system? 10 22
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 “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…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

803 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