This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet .....need help to run the applet  RSS feed

Kajol Shroff
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had some queries related to running an applet.
I am going through TIJ...CH 13
The code for the applet is as follows:
import javax.swing.*;
import java.awt.*;
public class Applet1 extends JApplet {
public void init() {
getContentPane().add(new JLabel("Applet by Salil Potnis!"));
The HTML file for the applet is given below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<applet code="Applet1.class" width="250" height="250" name="Applet1"></applet>

When I view the applet in Netscape it gives me the following error:
"Applet1 error: java.lang.NoClassFoundError:javax/swing/JApplet"
What I am doing is just compiling the file on DOS prompt and then viewing it in HTML
But when I went through TIJ codes the HTML file given there is as follows:
width="100" height="50" align="baseline" codebase=",2,2,0">
<PARAM NAME="code" VALUE="Applet1.class">
<PARAM NAME="codebase" VALUE=".">
<PARAM NAME="type" VALUE="application/x-java-applet;version=1.2.2">
<EMBED type=
width="200" height="200" align="baseline"
code="Applet1.class" codebase="."
No Java 2 support for APPLET!!
The classpath I have set is as follows:
is that right........
I am really confused as what is the above code all about...
I really need help..... reply me
Suneel Setlur
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kajol
There is no problem with the code. It runs properly.
Your settings must be :

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!