473,770 Members | 1,994 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to run Applet

58 New Member
Hi All

I got a problem in running java Applet

i am not able to run java applet while running i got a problem as
Loading Java Applet Failed

java.lang.NoCla ssDefFoundError : App (wrong name: src/App)
at java.lang.Class Loader.defineCl ass1(Native Method)
at java.lang.Class Loader.defineCl ass(Unknown Source)
at java.security.S ecureClassLoade r.defineClass(U nknow n Source)
at sun.applet.Appl etClassLoader.f indClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadClass(Unknow n Source)
at java.lang.Class Loader.loadClas s(Unknown Source)
at sun.applet.Appl etClassLoader.l oadCode(Unknown Source)
at sun.applet.Appl etPanel.createA pplet(Unknown Source)
at sun.plugin.Appl etViewer.create Applet(Unknown Source)
at sun.applet.Appl etPanel.runLoad er(Unknown Source)
at sun.applet.Appl etPanel.run(Unk nown Source)
at java.lang.Threa d.run(Unknown Source)

myhtml file is like this

Code:

<html>

<head>


<title>My Applet</title>



</head>


<body>

<h1>Network Applet</h1>

<APPLET CODE="App.class " CODEBASE = "\src" WIDTH=200 HEIGHT=50>


</APPLET>



</body>

</html>



the App.java file is
App.java

[code]
package src;
import java.awt.*;
import java.applet.*;
import javax.swing.JAp plet;
public class App extends JApplet
{
public void paint(Graphics g)
{
g.drawString("H ello",100,100);
}
}

I kept the html file and App.class file in src directory...
so that i specified the CODEBASE in html file like CODEBASE = "\src"
i changed this in so many ways also but no use
i specified complete path of .class file also but it was not run for me..

my directory structure is

src----
app.java
app.class
myhtml.html

Iam using ant to build application so that i also set path to ant...
my jdk path settings are

CLASSPATH
C:\j2sdk1.4.2_1 2\bin;C:\j2sdk1 .4.2_12\lib;
path
C:\ant\bin;C:\j 2sdk1.4.2_12\bi n;
JAVA_HOME
C:\j2sdk1.4.2_1 2
ANT_HOME
C:\ant

can anybody help me please.......I need it very much
Mar 9 '07 #1
0 1480

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9523
by: nathanlaan | last post by:
This is the stupidest thing I have ever seen. Java 1.2, 1.3, and 1.4.1, and 1.4.2 all define the Applet.getDocumentBase() method differently! How am I supposed to get the directory of the document in which the applet is embedded (like Java 1.3) using Java 1.4.2??? http://java.sun.com/products/jdk/1.2/docs/api/java/applet/Applet.html#getDocumentBase() http://java.sun.com/j2se/1.3/docs/api/java/applet/Applet.html#getDocumentBase()
0
9873
by: James Hong | last post by:
Help please, I try to sending an email from my html page using the java applet. but it give error on most of the PC only very few work, what is the error i make the java applet show as below ********************************** package Celcom.Client;
1
2944
by: Charlie Kim | last post by:
Here is gnome applet source of mine. -------------------------------------------------- #!/usr/bin/env python import pydic import gtk import gnome.applet
1
4067
by: Tormod Omholt-Jensen | last post by:
Ï need to dynamically insert an applet into a document. In IE 6.0 my code works fine, but there seems to be problems in Opera 7. The page looks like there is allocated space for an applet. Printing the size of the document.applets array return as expected 0 before the insertion, and 1 after, in both Opera 7 and IE. However, the applet does not init properly (no painting). Anyone? Regards Tormod Omholt-Jensen
2
1759
by: Roberto Gallo | last post by:
Hi; I have two problems regarding Scripts and Applets. I need to construct a page that has some instances of the same Applet. These instances are responsible to get informations from the user and the system. The information is latter sent to the site. How can I reference distinct Applets instances of the same Applet Class inside the page? How can I get the values stored in the Applet's variables using
8
3393
by: DKM | last post by:
Here are the source code files to a Java applet that utilizes LiveConnect to communicate with Javascript, and the HTML file. The thing works both in IE 6.0 and FireFox 1.4. but with some problems. IE crashes when one refreshes the page or leave the page. This happens only after calling the Java method more than once. It does not crash if the Java method is called just once and then the page is refreshed. FireFox does not crash at all...
0
5663
by: ankur | last post by:
WHEN I RUN THIS WEB APPLICATION ON Tomcat5.5.9 SERVER MY HttpChatApplet sccessfully Loaded from ChatDispatch but running on some another PC HttpChatApplet not loaded my Coad ChatDispatch.java
4
7822
by: tudyfruity18 | last post by:
I'm suppose to write an applet that contains two buttons Investment calculator and Loan Calculator. When the Investment Calculator button is clicked, a frame appears in a new window for calculating future investment values. When you click Loan Calculator button, a frame appears in a separate new window for computong loan payments. Here's my coding: // Lab3.java: import java.awt.*; import java.awt.event.*; import javax.swing.*; ...
1
2387
by: sheephead86 | last post by:
Hi, I'm pretty new to java, and I have a small problem involving drawing a rectangle on a java applet.Firstly this is not a plea for someone to help me with this peice of work, I just need pointing in the right direction. Ok the problem. I am creating a program that ask the user to input a height value, the program will then do a calculation and create a golden ratio width. The type of both the height and the width are double. This is...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10259
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10101
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8933
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2849
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.